Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Utils={setElementClassName:function(a,c){if(!a){return"";
}if(!c){a.className="";
a.removeAttribute("class",0);
a.removeAttribute("classname",0);
}else{var b=a.className;
a.className=c;
return b;
}},addElementsToSelection:function(d,f){if($telerik.isIE){Telerik.Web.UI.Editor.Utils.selectElement(d,f[0]);
return 1;
}var e=d.getSelection();
var b=new Telerik.Web.UI.Editor.Selection(d);
var a=b.getRange();
if(!a||!a.selectNodeContents){return -1;
}if(e.removeAllRanges){e.removeAllRanges();
}for(var c=0;
c<f.length;
c++){a.selectNodeContents(f[c]);
e.addRange(a);
}return f.length;
},getFullySelectedElement:function(a){return $telerik.isIE?Telerik.Web.UI.Editor.Utils._getFullySelectedElementIE(a):Telerik.Web.UI.Editor.Utils._getFullySelectedElementMoz(a);
},_isListFullySelected:function(b,c){if(b.tagName=="UL"||b.tagName=="OL"){var a=c.match(/<LI\/?>/gi);
if(a.length==b.getElementsByTagName("LI").length){return true;
}}return false;
},_getFullySelectedElementIE:function(n){var b=new Telerik.Web.UI.Editor.Selection(n);
var e=b.getRange();
var i=(e.length>0?e(0):e.parentElement());
if(e.length>0){return i;
}else{if(i.tagName=="A"){var h=e.duplicate();
h.moveToElementText(i);
if(e.inRange(h)){return i;
}}else{if(Telerik.Web.UI.Editor.Utils._isListFullySelected(i,b.getHtml())){return i;
}else{if(!e.htmlText){return null;
}}}}var c=e.duplicate();
var d=e.duplicate();
c.collapse(true);
d.collapse(false);
var o=c.parentElement();
if(o.parentNode==i){o=i;
}var g=d.parentElement();
if(o==g){var k=n.document;
var l=k.body.createTextRange();
l.moveToElementText(o);
var m=e.htmlText;
var a=false;
var f=o.outerHTML.replace(/[\r\n\t]/ig,"");
var p=o.innerHTML.replace(/[\r\n\t]/ig,"");
m=m.replace(/[\r\n\t]/ig,"");
if(f==m||p==m){a=true;
}if(a||(0==l.compareEndPoints("StartToStart",e)&&0==l.compareEndPoints("EndToEnd",e))){if("BODY"!=i.tagName){return i;
}}}},_getFullySelectedElementMoz:function(e){var k=e.document;
var m=e.getSelection();
if(m.rangeCount<1){return null;
}var h=m.getRangeAt(0);
var a=h.commonAncestorContainer;
var d=a.parentNode;
var c=new Telerik.Web.UI.Editor.Selection(e);
if($telerik.isFirefox){var f=c.getHtml();
var n=document.createElement("DIV");
n.innerHTML=f;
if(n.childNodes.length==1&&n.firstChild.nodeType==1){var g=n.firstChild.tagName;
var b=h.startContainer;
if(b.nodeType==1){if(b.tagName==g){return b;
}else{if(b.getElementsByTagName){b=b.getElementsByTagName(g)[0];
if(b){return b;
}}}}else{while(b){if(g==b.tagName){return b;
}b=b.nextSibling;
}}}}if(a.tagName=="BODY"){var l=c.getParentElement();
if(l&&l.tagName!="BODY"){return l;
}}else{var i=k.createElement("SPAN");
i.appendChild(h.cloneContents());
if(i.innerHTML==d.innerHTML&&d.tagName!="BODY"){return d;
}}if(Telerik.Web.UI.Editor.Utils._isListFullySelected(a,c.getHtml())){return a;
}},getInvisibleParent:function(a){while(a!=document){if("none"==$telerik.getCurrentStyle(a,"display","")){return a;
}a=a.parentNode;
}return null;
},cleanPastedContent:function(a,e,d,c){var b=a;
if(e==Telerik.Web.UI.StripFormattingOptions.None){if((a.match(/style="[^"]*?mso[^"]*?"/ig)||a.match(/class="?[^"]*?mso[^"]*?"?/ig))&&confirm(d)){a=Telerik.Web.UI.Editor.Utils._convertWordLists(a);
b=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"WORD");
}}else{if(e&Telerik.Web.UI.StripFormattingOptions.All){b=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"ALL");
}else{if(e&Telerik.Web.UI.StripFormattingOptions.AllExceptNewLines){b=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"ALL_NO_BRAKES");
}else{if(e&Telerik.Web.UI.StripFormattingOptions.ConvertWordLists){a=Telerik.Web.UI.Editor.Utils._convertWordLists(a);
}if(e&Telerik.Web.UI.StripFormattingOptions.MSWordRemoveAll){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"WORD_ALL");
}if(e&Telerik.Web.UI.StripFormattingOptions.MSWordNoFonts){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"WORD_NO_FONTS");
}if(e&Telerik.Web.UI.StripFormattingOptions.MSWord){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"WORD");
}if(e&Telerik.Web.UI.StripFormattingOptions.Css){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"CSS");
}if(e&Telerik.Web.UI.StripFormattingOptions.Font){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"FONT");
}if(e&Telerik.Web.UI.StripFormattingOptions.Span){a=Telerik.Web.UI.Editor.Utils.stripFormatting(a,"SPAN");
}b=a;
}}}if(null!=c&&false==c){b=Telerik.Web.UI.Editor.Utils.stripFormatting(b,"SCRIPT");
}return b;
},isCursorMovingKey:function(a){if(a>=33&&a<=40){return true;
}return false;
},isSystemKey:function(a){if(a>=112&&a<=123){return true;
}if(a>=8&&a<=27){return true;
}if(a>=32&&a<=46){return true;
}if(a==93){return true;
}return false;
},storeBrowserPosition:function(){var a=document.body;
var b=document.documentElement;
this._browserTop=a.scrollTop>b.scrollTop?a.scrollTop:b.scrollTop;
this._browserLeft=a.scrollLeft>b.scrollLeft?a.scrollTop:b.scrollLeft;
return{x:this._browserLeft,y:this._browserTop};
},restoreBrowserPosition:function(d,b){try{if(null==d){d=this._browserLeft;
}if(null==b){b=this._browserTop;
}var a=document.body;
var c=document.documentElement;
a.scrollTop=b;
a.scrollLeft=d;
c.scrollTop=b;
c.scrollLeft=d;
}catch(e){}},_getPasteIframe:function(){if(!this._pasteIframe){this._pasteIframe=document.createElement("IFRAME");
var c=this._pasteIframe.style;
c.width="1px";
c.height="1px";
c.border="0px solid red";
c.overflow="hidden";
c.position="absolute";
document.body.appendChild(this._pasteIframe);
try{var b=this._pasteIframe.contentWindow.document;
var a=b.open("text/html","replace");
var f="<html><head><title>New Document</title></head><body contentEditable='true' style='overflow:hidden;margin:0px;padding:0px;height:100%'></html>";
a.write(f);
a.close();
}catch(d){}}return this._pasteIframe;
},getPasteContainer:function(){var a=this._getPasteIframe();
return a.contentWindow.document.body;
},getClipboardAsHtml:function(){var a=this.getPasteContainer();
a.innerHTML="";
if(a.setActive){a.setActive();
}document.execCommand("Paste",null);
var b=a.innerHTML;
a.innerHTML="";
return b;
},_convertWordLists:function(o){var k=function(u,p){if(!u){return 0;
}if(typeof(u.length)!="undefined"){for(var t=0,v=u.length;
t<v;
t++){if(p.call(u,u[t],t,u)===false){return 0;
}}}return 1;
};
var r=function(u,p){if(u){for(var t=0,v=u.length;
t<v;
t++){if(u[t]===p){return t;
}}}return -1;
};
var f=function(u,t){var i=[];
if(u&&t){var p=u.parentNode;
while(p){if(p.tagName&&p.tagName.toLowerCase()==t.toLowerCase()){i.push(p);
}p=p.parentNode;
}}return i;
};
o=o.replace(/<!--\[if !supportLists\]-->/gi,"_TELERIK_I_");
o=o.replace(/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1_TELERIK_I_");
o=o.replace(/(<span[^>]+mso-list:[^>]+>)/gi,"$1_TELERIK_I_");
var d=document.createElement("div");
d.innerHTML=o;
var m=d.getElementsByTagName("P");
var l,c,g=-1,a,h=[],s,e,b=[];
k(m,function(B){if(!B){return;
}var w="",y,E;
for(var t=B.firstChild;
t&&t.nodeType==3;
t=t.nextSibling){w+=t.nodeValue;
}w=B.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");
if(/^(_TELERIK_I_)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(w)){y="ul";
B.innerHTML=B.innerHTML.replace(/(<span[^>]+style="font[^>]+>)/gi,"$1_TELERIK_I_");
}if(/^_TELERIK_I_\s*\w+\.\s*\u00a0{2,}/.test(w)){y="ol";
}if(y){a=parseFloat(B.style.marginLeft||0);
if(a>g){h.push(a);
}if(!l||y!=s){l=document.createElement(y);
var x=B.parentNode;
var z=B.nextSibling;
if(z){x.insertBefore(l,z);
}else{x.appendChild(l);
}}else{if(a>g){l=c.appendChild(document.createElement(y));
}else{if(a<g){var A=f(l.parentNode,y);
l=A[A.length-1-r(h,a)]||l;
}}}sElements=B.getElementsByTagName("SPAN");
if(sElements.length>0){var v=[];
k(sElements,function(p){if(!p){return;
}var i=p.innerHTML;
if(/^_TELERIK_I_[\s\S]*[?o]/.test(i)){v.push(p);
}if(y!="ul"&&/^[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(i)){v.push(p);
}});
for(var C=0,D=v.length;
C<D;
C++){var u=v[C];
if(u&&u.parentNode){u.parentNode.removeChild(u);
}}}if(y=="ul"){E=w.replace(/_TELERIK_I_/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*(&nbsp;|\u00a0)+\s*/,"");
}else{E=w.replace(/_TELERIK_I_/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"");
}c=document.createElement("li");
c.innerHTML=E;
l.appendChild(c);
b.push(B);
g=a;
s=y;
}else{l=g=0;
}});
for(var n=0;
n<b.length;
n++){var q=b[n];
q.parentNode.removeChild(q);
}return d.innerHTML.replace(/_TELERIK_I_/g,"");
},stripFormatting:function(b,a){switch(a){case"ALL":b=b.replace(new RegExp("<(SCRIPT|STYLE)([^>]*)>[\\s\\S]*?</(\\1)([^>]*)>","ig"),"");
b=b.replace(new RegExp("<!--[\\s\\S]*?-->","ig"),"");
b=b.replace(/<\/?[^>]*>/ig,"");
break;
case"ALL_NO_BRAKES":b=b.replace(/<BR(\s[^>]*)?\/?>/ig,"~RADEDITORBRAKE~");
b=b.replace(new RegExp("<(SCRIPT|STYLE)([^>]*)>[\\s\\S]*?</(\\1)([^>]*)>","ig"),"");
b=b.replace(new RegExp("<!--[\\s\\S]*?-->","ig"),"");
b=b.replace(/<\/?[^>]*>/ig,"");
b=b.replace(/~RADEDITORBRAKE~/ig,"<br/>");
b=b.replace(/\n/ig,"<br/>");
b=b.replace(/\r/ig,"");
break;
case"WORD":case"WORD_ALL":case"WORD_NO_FONTS":b=this.stripWordFormatting(b,a);
break;
case"CSS":b=b.replace(new RegExp("(<[^>]+) class=[^ |^>]*([^>]*>)","ig"),"$1 $2");
b=b.replace(/(<[^>]+) style="[^"]*"([^>]*>)/ig,"$1 $2");
break;
case"FONT":b=b.replace(/<\/?font[^>]*>/ig,"");
break;
case"SPAN":b=b.replace(/<\/?span[^>]*>/ig,"");
break;
case"SCRIPT":b=b.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
b=b.replace(new RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
break;
default:break;
}return b;
},replaceNewLineWithBr:function(b){try{b=b.replace(/\n/g,"<br>");
return b;
}catch(a){}},convertText2Html:function(b){try{b=b.replace(/</g,"&lt;");
b=b.replace(/>/g,"&gt;");
b=b.replace(/\n/g,"<br>");
return b;
}catch(a){}},clearWordAttributesInElement:function(a,d){var f=$telerik.isIE?a.all:a.getElementsByTagName("*");
for(var e=0;
e<f.length;
e++){var g=f[e];
var c=new RegExp("mso","gi");
if(g.nodeType==1){if(c.exec(g.className)){g.className="";
}g.removeAttribute("lang","",0);
g.removeAttribute("stylw","",0);
g.style.cssText=g.style.cssText.replace(/(([\w-]*?mso[\w-]*?):(.+?)([;^$]|$))/gi,"");
if($telerik.isIE){g.style.removeAttribute("tab-stops",0);
g.style.removeAttribute("textIndent",0);
}if($telerik.isIE&&(d=="WORD_NO_FONTS"||d=="WORD_ALL")){g.style.removeAttribute("fontFamily",0);
g.removeAttribute("face",0);
}if(g.style&&g.style.fontFamily&&/('|"|&quot;)/.test(g.style.fontFamily)){if($telerik.isIE){g.style.removeAttribute("fontFamily",0);
}else{g.style.fontFamily="";
}}for(j=g.attributes.length-1;
j>=0;
j--){var b=g.attributes[j];
if("null"!=b.value&&""!=b.value){if(c.exec(b.name)||c.exec(b.value)){g.removeAttribute(b.name);
}}}}}},stripWordFormatting:function(b,c){var f=b;
if(c=="WORD_ALL"){var e=/<SPAN[^>]*?>([\s\S]*?)<\/SPAN[^>]*?>/ig;
while(f.match(e)){f=f.replace(e,"$1");
}var a=/<FONT[^>]*?>([\s\S]*?)<\/FONT[^>]*?>/ig;
while(f.match(a)){f=f.replace(a,"$1");
}}f=f.replace(/<span>([^<>]+)<\/span>/gi,"<span EditorSaved='true'>$1</span>");
f=f.replace(/<font>([^<>]+)<\/font>/gi,"<font EditorSaved='true'>$1</font>");
if($telerik.isFirefox){f=f.replace(/<(?:link|meta) [^>]+>/ig,"");
f=f.replace(/<!--\[if [^\]]+]>[\s\S]+?<!\[endif\]-->/ig,"");
f=f.replace(/<style[^>]*?>[\s\S]*?<\/style>/ig,"");
}f=f.replace(/<o:p>&nbsp;<\/o:p>/gi,"");
f=f.replace(/<\/?o:[^>]*>/gi,"");
f=f.replace(/ class=\"(mso[^\"]*)\"/gi,"");
f=f.replace(/ class=(mso\w+)/gi,"");
f=f.replace(/<!--[\s\S]+?-->/gi,"");
f=f.replace(/<\\?\?xml[^>]*>/gi,"");
f=f.replace(/^(?:\s|&nbsp;)+/i,"");
f=f.replace(/(?:\s|&nbsp;)+$/i,"");
var d=document.createElement("DIV");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(d,f);
this.clearWordAttributesInElement(d,c);
f=d.innerHTML;
f=f.replace(/\t/g," ");
f=f.replace(/<\/?\w+:[^>]*>/gi,"");
f=f.replace(/<\\?\??xml[^>]>/gi,"");
f=f.replace(/<p>&nbsp;<\/p>/gi,"<BR><BR>");
f=f.replace(/[ ]+/g," ");
f=f.replace(/<st1:.*?>/gi,"");
f=f.replace(/<font>([^<>]+)<\/font>/gi,"$1");
f=f.replace(/<span>([^<>]+)<\/span>/gi,"$1");
f=f.replace(/[\s]+EditorSaved=[\'\"]true[\'\"]/gi,"");
f=f.replace(/style=(""|'')/ig,"");
f=f.replace(/class=(""|'')/ig,"");
f=f.replace(/v:shape="[^"]+"/ig,"");
f=f.replace(/<span[^>]*>\s*<\/span[^>]*>/ig," ");
f=f.replace(/<font[^>]*>\s*<\/font[^>]*>/ig," ");
f=f.replace(/\s+/ig," ");
return f;
},createTable:function(g,d,b){if(!b){b=document;
}var f=b.createElement("TABLE");
for(var a=0;
a<g;
a++){oRow=f.insertRow(-1);
for(var e=0;
e<d;
e++){oCell=oRow.insertCell(-1);
oCell.innerHTML="&nbsp;";
}}return f;
},getElementParentByTag:function(a,c){if(null==a){return null;
}if(null==c){return a;
}try{while(a&&null!=a.tagName&&a.tagName!=c){a=a.parentNode;
}return((a.tagName==c)?a:null);
}catch(b){return null;
}},selectElement:function(f,c){if(!c){return;
}var b=f.document;
if($telerik.isIE){var a;
switch(c.tagName){case"TABLE":case"IMG":case"HR":case"INPUT":a=b.body.createControlRange();
a.add(c);
break;
case"UL":case"OL":a=b.body.createTextRange();
a.moveToElementText(c);
var d=a.parentElement();
if(d.tagName!="UL"||d.tagName!="OL"){a.moveEnd("character",-1);
}break;
default:a=b.body.createTextRange();
a.moveToElementText(c);
break;
}if(a){a.select();
return true;
}}else{if(f.getSelection){var a=b.createRange();
a.selectNode(c);
if(window.opera){a.selectNodeContents(c);
}var e=f.getSelection();
if($telerik.isSafari){if(c.tagName!="TD"&&c.tagName!="TH"){e.setBaseAndExtent(a.startContainer,a.startOffset,a.endContainer,a.endOffset);
}}else{e.removeAllRanges();
e.addRange(a);
}return true;
}}return false;
},getOuterHtml:function(a){return $telerik.getOuterHtml(a);
},setElementInnerHtml:function(b,c){var a=$telerik.isIE?this.getStoredOriginalPathsAndAttributes(c):c;
b.innerHTML="<span>&nbsp;</span>"+a;
b.removeChild(b.firstChild);
if($telerik.isIE){this.restoreOriginalPathsAndAttributes(b);
}},removeNode:function(b){var a=b.parentNode;
if(a!=null){while(b.childNodes&&b.childNodes.length>0){a.insertBefore(b.childNodes[0],b);
}a.removeChild(b);
return a;
}return true;
},getStoredOriginalPathsAndAttributes:function(b){var a=function(o,i,m,f,k,p,h,g,n){if(!f){f="";
k=k+h;
var l=k.search(/(\s|>)/gi);
if(l>0){h=k.substring(l,k.length);
k=k.substring(0,l);
if(k=='""'){k="";
f='"';
}}else{return o;
}}return i+" "+m+"="+f+k+f+' originalAttribute="'+m+'" originalPath="'+k+'"'+h;
};
var c=new RegExp("(<[^>]*?)\\s(href|src)\\s*=\\s*('|\")?([^>]+?)(\\3)([^>]*?>)","ig");
b=b.replace(c,a);
var e=new RegExp('(<!--[^(-->)]+) originalAttribute="(?:href|src)" originalPath="[^"]+"([\\s\\S]*?-->)',"ig");
var d=b.length+1;
while(b.length<d){d=b.length;
b=b.replace(e,"$1$2");
}return b;
},restoreOriginalPathsAndAttributes:function(b){var d=b.getElementsByTagName("*");
for(var e=0;
e<d.length;
e++){var g=d[e];
var f=g.getAttribute("originalPath");
var a=g.getAttribute("originalAttribute");
if(f!=null&&a!=null){g.removeAttribute("originalPath");
g.removeAttribute("originalAttribute");
if(f.toLowerCase().indexOf("mailto:")==0){continue;
}f=f.replace(window.location.href+"#","#");
var c=g.innerHTML;
g.setAttribute(a,f,0);
if(c!=g.innerHTML){g.innerHTML=c;
}}}},_encodeHtmlContent:function(a,e){var d=new Array("%","<",">","!",'"',"#","$","&","'","(",")",",",":",";","=","?","[","]","\\","^","`","{","|","}","~","+");
var c=a;
var b;
if(e){for(b=0;
b<d.length;
b++){c=c.replace(new RegExp("\\x"+d[b].charCodeAt(0).toString(16),"ig"),"%"+d[b].charCodeAt(0).toString(16));
}}else{for(b=d.length-1;
b>=0;
b--){c=c.replace(new RegExp("%"+d[b].charCodeAt(0).toString(16),"ig"),d[b]);
}}return c;
},encodePostbackContent:function(a){return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(a,true);
},decodePostbackContent:function(a){return Telerik.Web.UI.Editor.Utils._encodeHtmlContent(a,false);
},makeUrlAbsolute:function(a){a=a.split("&").join("&amp;").split('"').join("&quot;").split("<").join("&lt;");
var b=document.createElement("div");
b.innerHTML='<a href="'+a+'">a</a>';
return b.childNodes[0].href;
},addStyleSheet:function(c,a,e){if(!c){return;
}a=a||document;
var f=a.createElement("link");
f.setAttribute("href",c,0);
if($telerik.isIE&&f.href.indexOf("https://")==0&&c.indexOf("https://")!=0){f.setAttribute("href",f.href);
}else{if($telerik.isIE7&&c.indexOf("https://")!=0&&f.href.indexOf("https://")!=0&&window.location.protocol=="https:"){f.setAttribute("href",Telerik.Web.UI.Editor.Utils.makeUrlAbsolute(c),0);
}}f.setAttribute("type","text/css");
if(e){f.setAttribute("id",e);
}else{e="";
}f.setAttribute("rel","stylesheet",0);
var b=a.getElementsByTagName("head")[0];
if($telerik.isSafari){var d=function(){b.appendChild(f);
};
window.setTimeout(d,200);
}else{b.appendChild(f);
}},_copyElementsBetweenNodes:function(d,g,e){var f=d.getElementsByTagName(e);
var k=g.getElementsByTagName(e);
for(var a=0;
a<f.length;
a++){switch(e){case"script":case"title":k[a].text=f[a].text;
break;
case"style":if(k[a].innerHTML!=f[a].innerHTML){k[a].styleSheet.cssText=f[a].styleSheet.cssText;
}break;
case"select":k[a].selectedIndex=f[a].selectedIndex;
break;
case"iframe":var h=f[a].innerHTML;
if(h){var b=k[a].outerHTML;
if(b){var c=b.indexOf(">");
if(c>0){b=b.substr(0,c)+">"+h+b.substr(c+1);
k[a].outerHTML=b;
}}}break;
default:Telerik.Web.UI.Editor.Utils.setElementInnerHtml(k[a],f[a].innerHTML);
break;
}}},cloneNodeWithChildren:function(a){if(!a){return null;
}if($telerik.isIE&&a.getElementsByTagName){var b=a.cloneNode(true);
if(typeof(b.innerHTML)!="string"){this.setElementInnerHtml(b,a.innerHTML);
}this._copyElementsBetweenNodes(a,b,"script");
this._copyElementsBetweenNodes(a,b,"map");
this._copyElementsBetweenNodes(a,b,"style");
this._copyElementsBetweenNodes(a,b,"title");
this._copyElementsBetweenNodes(a,b,"select");
this._copyElementsBetweenNodes(a,b,"iframe");
return b;
}else{return a.cloneNode(true);
}},escapeRegExSpecialChars:function(a){var b=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");
return a.replace(b,"\\$&");
},getUniqueID:function(){if(!window.RadEditor_uniqueSeed){window.RadEditor_uniqueSeed=new Date()-101;
}if(!window.RadEditor_uniqueIdCounter){window.RadEditor_uniqueIdCounter=1;
}else{window.RadEditor_uniqueIdCounter++;
}var a=window.RadEditor_uniqueSeed-window.RadEditor_uniqueIdCounter;
return"UniqueID"+a;
},getTextContent:function(a){if(!a){return null;
}if(a.innerText!=null){return a.innerText;
}if(a.textContent!=null){var b=a.textContent;
b=b.replace(/<!--(.|\s)*?-->/gi,"");
return b;
}return null;
},_rgbToHex:function(c){if(c.toLowerCase().indexOf("rgb")!=-1){var b="#";
var a=function(e){var d=parseInt(e,10).toString(16);
b=b+(d.length==1?"0"+d:d);
return e;
};
c=c.replace(/(\d+)/gi,a);
a=null;
return b;
}else{return c;
}}};
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandStates=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.Editor.CommandStates.prototype={Disabled:-1,Off:0,On:1};
Telerik.Web.UI.Editor.CommandStates.registerEnum("Telerik.Web.UI.Editor.CommandStates",false);
Telerik.Web.UI.Editor.CommandBase=function(a,c,b){this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
this._title=a;
this._window=c;
this._isExecuted=false;
this._canUnexecute=(b!=false);
};
Telerik.Web.UI.Editor.CommandBase.prototype={get_argument:function(){return null;
},getState:function(a){return Telerik.Web.UI.Editor.CommandStates.Off;
},getValue:function(a){return null;
},set_window:function(a){this._window=a;
},get_window:function(){return this._window;
},get_title:function(){return this._title;
},set_title:function(a){this._title=a;
},execute:function(){this._isExecuted=false;
if(null==this.onExecute||null==this.get_window()){return false;
}try{if(!this.RestorePoint1){this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{this.RestorePoint1.select();
}return(this._isExecuted=this.onExecute());
}catch(a){}return false;
},onExecute:function(){if(this.isIE&&null!=this.OnExecuteIE){return this.OnExecuteIE();
}else{if(null!=window.getSelection&&null!=this.OnExecuteMoz){return this.OnExecuteMoz();
}}return false;
},unexecute:function(){try{if(this._canUnexecute&&this._isExecuted){this.RestorePoint1.restore();
}}catch(a){}}};
Telerik.Web.UI.Editor.CommandBase.registerClass("Telerik.Web.UI.Editor.CommandBase",null);
Telerik.Web.UI.Editor.PasteHtmlCommand=function(a,d,b,c){Telerik.Web.UI.Editor.PasteHtmlCommand.initializeBase(this,[(a||"Insert Html"),d,true]);
this.HtmlText=b;
this.SelectText=(true==c);
};
Telerik.Web.UI.Editor.PasteHtmlCommand.prototype={clone:function(){return new Telerik.Web.UI.Editor.PasteHtmlCommand(this.get_title(),this.get_window(),this.HtmlText);
},onExecute:function(){var a=new Telerik.Web.UI.Editor.Selection(this.get_window());
a.pasteHtml(this.HtmlText,this.SelectText);
return true;
}};
Telerik.Web.UI.Editor.PasteHtmlCommand.registerClass("Telerik.Web.UI.Editor.PasteHtmlCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.GenericCommand=function(a,b){Telerik.Web.UI.Editor.GenericCommand.initializeBase(this,[a,b,true]);
this.RestorePoint1=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
};
Telerik.Web.UI.Editor.GenericCommand.prototype={execute:function(){if(null==this.RestorePoint2){this.RestorePoint2=new Telerik.Web.UI.Editor.RestorePoint(this.get_window());
}else{this.RestorePoint2.restore();
}return true;
},unexecute:function(){this.RestorePoint1.restore(true);
}};
Telerik.Web.UI.Editor.GenericCommand.registerClass("Telerik.Web.UI.Editor.GenericCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TextTypeCommand=function(a,b){Telerik.Web.UI.Editor.TextTypeCommand.initializeBase(this,[(a||"Typing"),b]);
};
Telerik.Web.UI.Editor.TextTypeCommand.prototype={update:function(){if(this.RestorePoint2){this.RestorePoint2.update();
}}};
Telerik.Web.UI.Editor.TextTypeCommand.registerClass("Telerik.Web.UI.Editor.TextTypeCommand",Telerik.Web.UI.Editor.GenericCommand);
Telerik.Web.UI.Editor.BrowserCommand=function(c,e,a,b){var d=true;
switch(this.CommandID){case"Copy":case"SelectAll":case"Print":d=false;
break;
}Telerik.Web.UI.Editor.BrowserCommand.initializeBase(this,[(c||a),e,d]);
this.CommandID=a;
this.Value=b;
};
Telerik.Web.UI.Editor.BrowserCommand.prototype={get_argument:function(){return this.Value;
},clone:function(){return new Telerik.Web.UI.Editor.BrowserCommand(this._title,this.get_window(),this.CommandID,this.Value);
},getState:function(e){try{e=e||this.get_window();
var b=e.document;
if(null==b){return Telerik.Web.UI.Editor.CommandStates.Disabled;
}var c=true;
if("Paste"!=this.CommandID){c=b.queryCommandEnabled(this.CommandID);
}else{if(!$telerik.isIE7){c=b.queryCommandEnabled(this.CommandID);
}}if(!this.isOpera&&!c){if(!this.isSafari||!this.CommandID=="RealFontSize"){return Telerik.Web.UI.Editor.CommandStates.Disabled;
}}var a=null;
if("Paste"!=this.CommandID){a=b.queryCommandState(this.CommandID);
}else{if(!$telerik.isIE7){a=b.queryCommandState(this.CommandID);
}}return a?Telerik.Web.UI.Editor.CommandStates.On:Telerik.Web.UI.Editor.CommandStates.Off;
}catch(d){return Telerik.Web.UI.Editor.CommandStates.Off;
}},getValue:function(b){try{b=b||this.get_window();
return b.document.queryCommandValue(this.CommandID);
}catch(a){}return null;
},onExecute:function(){var g=this.get_window();
if(!g){return false;
}var c=g.document;
if("AbsolutePosition"==this.CommandID){c.execCommand("2D-Position",false,true);
}var b=true;
if(this.CommandID=="BackColor"&&(this.isOpera||this.isFirefox)){this.CommandID="HiliteColor";
b=false;
}if(this.CommandID=="FontSize"&&this.isSafari2){var a=parseInt(this.Value);
switch(a){case 1:this.Value="8pt";
break;
case 2:this.Value="10pt";
break;
case 3:this.Value="12pt";
break;
case 4:this.Value="14pt";
break;
case 5:this.Value="18pt";
break;
case 6:this.Value="24pt";
break;
case 7:this.Value="36pt";
break;
}}try{c.execCommand("UseCSS",false,(false!=b));
c.execCommand("styleWithCSS",false,(false==b));
}catch(d){}var f=c.execCommand(this.CommandID,false,this.Value);
try{c.execCommand("UseCSS",false,true);
c.execCommand("styleWithCSS",false,false);
}catch(d){}return f;
}};
Telerik.Web.UI.Editor.BrowserCommand.registerClass("Telerik.Web.UI.Editor.BrowserCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.StyleRuleCommand=function(a,f,b,c,e){Telerik.Web.UI.Editor.StyleRuleCommand.initializeBase(this,[(a||sCmdID),f,true]);
if(!b){var d=new Telerik.Web.UI.Editor.Selection(this._window);
b=d.getParentElement();
}this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,b);
this._styleAttributeName=c;
this._newValue=e;
};
Telerik.Web.UI.Editor.StyleRuleCommand.prototype={get_argument:function(){return this._newValue;
},clone:function(){return new Telerik.Web.UI.Editor.StyleRuleCommand(this._title,this._window,null,this._styleAttributeName,this._newValue);
},execute:function(){var a=this._nodeBookmark.select();
if(!a){return false;
}if(!this._isExecuted){this._oldValue=a.style[this._styleAttributeName];
}a.style[this._styleAttributeName]=this._newValue;
this._isExecuted=true;
return true;
},unexecute:function(){var a=this._nodeBookmark.select();
a.style[this._styleAttributeName]=this._oldValue;
}};
Telerik.Web.UI.Editor.StyleRuleCommand.registerClass("Telerik.Web.UI.Editor.StyleRuleCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.AttributeCommand=function(a,f,b,c,e){Telerik.Web.UI.Editor.AttributeCommand.initializeBase(this,[(a||sCmdID),f,true]);
if(!b){var d=new Telerik.Web.UI.Editor.Selection(this._window);
b=d.getParentElement();
}this._nodeBookmark=new Telerik.Web.UI.Editor.SelectionBookmark(this._window,b);
this._attribName=c;
this._newValue=e;
};
Telerik.Web.UI.Editor.AttributeCommand.prototype={get_argument:function(){return this._newValue;
},clone:function(){return new Telerik.Web.UI.Editor.AttributeCommand(this._title,this._window,null,this._attribName,this._newValue);
},execute:function(){var b=this._nodeBookmark.select();
if(!b){return false;
}if(!this._isExecuted){if(this._attribName=="style"){this._oldValue=b.style.cssText;
}else{this._oldValue=b.getAttribute(this._attribName);
}}if(this._attribName&&this._attribName.toLowerCase()=="name"&&document.all){b.name=this._newValue;
b.removeAttribute("name");
b.removeAttribute("NAME");
}var a=this._newValue.trim();
if(""==a){b.removeAttribute(this._attribName,0);
if("className"==this._attribName){b.removeAttribute("class",0);
}}else{if(this._attribName=="style"){b.style.cssText=this._newValue;
}else{b[this._attribName]=this._newValue;
if(this._attribName.toLowerCase()=="nowrap"||this._attribName=="borderColor"){b.setAttribute(this._attribName,this._newValue);
}}}this._isExecuted=true;
return true;
},unexecute:function(){var a=this._nodeBookmark.select();
if(this._attribName=="style"){a.style.cssText=this._oldValue;
}else{a[this._attribName]=this._oldValue;
}}};
Telerik.Web.UI.Editor.AttributeCommand.registerClass("Telerik.Web.UI.Editor.AttributeCommand",Telerik.Web.UI.Editor.CommandBase);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.ClassNameCommand=function(b,c,a){Telerik.Web.UI.Editor.ClassNameCommand.initializeBase(this,[(b||"Classname"),c,true]);
};
Telerik.Web.UI.Editor.ClassNameCommand.prototype={getValue:function(a){a=a||this._window;
if($telerik.isIE){return this._getValueIE(a);
}else{return this._getValueMoz(a);
}},_getValueIE:function(c){var b=new Telerik.Web.UI.Editor.Selection(c);
var a=b.getParentElement();
if("BODY"==a.tagName){return"";
}else{return(""==a.className?"":a.className);
}},_getValueMoz:function(g){if(!g){return"";
}var c=g.getSelection();
if(!c){return"";
}if(c.rangeCount!=1){return"";
}var b=(c.focusNode.nodeType!=3?c.focusNode:c.focusNode.parentNode);
var e=(c.anchorNode.nodeType!=3?c.anchorNode:c.anchorNode.parentNode);
if(b!=e){return"";
}var d=new Telerik.Web.UI.Editor.Selection(g);
var f="",a;
if(null!=d&&null!=(a=d.getParentElement())){f=a.className;
}return(""==f?"":f);
}};
Telerik.Web.UI.Editor.ClassNameCommand.registerClass("Telerik.Web.UI.Editor.ClassNameCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.FormatBlockCommand=function(b,c,a){Telerik.Web.UI.Editor.FormatBlockCommand.initializeBase(this,[(b||"Format Block"),c,true]);
this.FormatValue=a;
};
Telerik.Web.UI.Editor.FormatBlockCommand.prototype={get_argument:function(){try{return this.FormatValue.substring(1,this.FormatValue.length-1).toUpperCase();
}catch(a){}},clone:function(){return new Telerik.Web.UI.Editor.FormatBlockCommand(this.Title,this._window,this.FormatValue);
},getValue:function(c){try{c=c||this._window;
var a=c.document.queryCommandValue("FormatBlock");
if(!document.all){switch(a){case"x":case"":a="Normal";
break;
}}return a;
}catch(b){}return null;
},onExecute:function(){var p=this._window.document;
var a=this.FormatValue;
if("<p>"==a.toLowerCase()){p.execCommand("FormatBlock",false,"Normal");
}var h=true;
var i=this._getTagName();
var b=new Telerik.Web.UI.Editor.Selection(this._window);
var n=b.getHtml();
if(n){if($telerik.isIE||$telerik.isFirefox||$telerik.isOpera){p.execCommand("RemoveFormat",false,null);
}var d=p.createElement(i);
d.innerHTML=b.getHtml();
var c=b.getText();
var k=Telerik.Web.UI.Editor.Utils.getTextContent(b.getParentElement());
var q=null;
var o=true;
if(k.trim().replace(/\s/gi,"")==c.trim().replace(/\s/gi,"")){q=b.getParentElement();
var l=q.tagName;
if(l=="BODY"||l=="TD"){o=false;
}if(!$telerik.isSafari&&o){q.parentNode.removeChild(q);
}}var e=$telerik.getOuterHtml(d);
var j=new Telerik.Web.UI.Editor.PasteHtmlCommand("--SYSTEM--",this._window,e,true);
h=j.execute();
if($telerik.isSafari&&q&&o){Telerik.Web.UI.Editor.Utils.removeNode(q);
}}else{h=p.execCommand("FormatBlock",false,"<"+i+">");
}var b=new Telerik.Web.UI.Editor.Selection(this._window);
var m=b.getParentElement();
if(m.tagName!=i){b.collapse(true);
b=new Telerik.Web.UI.Editor.Selection(this._window);
m=b.getParentElement();
}if(m.tagName==i){this._applyAttributes(m);
}var g=$telerik.getPreviousHtmlNode(m);
if(g&&g.tagName=="BR"){g.parentNode.removeChild(g);
}var f=$telerik.getNextHtmlNode(m);
if(f&&f.tagName=="BR"){f.parentNode.removeChild(f);
}if(n){Telerik.Web.UI.Editor.Utils.selectElement(this._window,m);
b=new Telerik.Web.UI.Editor.Selection(this._window);
b.collapse(false);
}return h;
},_getTagName:function(){var a=this.FormatValue.replace(/.*?<([^\s]+)(\s|\/|>).*/i,"$1");
return a.toUpperCase();
},_applyAttributes:function(d){if(!d){return;
}var b=this.FormatValue;
var a=document.createElement("DIV");
a.innerHTML=b+"</"+this._getTagName()+">";
if(a.firstChild){var c=a.firstChild;
if(c.className){d.className=c.className;
}if(c.style.cssText){d.style.cssText=c.style.cssText;
}}}};
Telerik.Web.UI.Editor.FormatBlockCommand.registerClass("Telerik.Web.UI.Editor.FormatBlockCommand",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.InsertListCommand=function(b,e,d,a,c){Telerik.Web.UI.Editor.InsertListCommand.initializeBase(this,[(b||"Insert List"),e,true]);
this._newLineBr=(d==true);
this._commandName=a;
this._listType=(a=="InsertOrderedList")?"OL":"UL";
this._listStyle=c;
this._document=this._window.document;
};
Telerik.Web.UI.Editor.InsertListCommand.prototype={_insertList:function(){return this._document.execCommand(this._commandName,false,false);
},OnExecuteMoz:function(){return this._insertList();
},OnExecuteIE:function(){if(!this._newLineBr){return this._insertList();
}var a=new Telerik.Web.UI.Editor.Selection(this._window);
var b=a.getParentElement();
var d=Telerik.Web.UI.Editor.Utils.getElementParentByTag;
if("OL"==b.tagName||"UL"==b.tagName||d(b,"UL")||d(b,"OL")){var k=this._insertList();
var a=new Telerik.Web.UI.Editor.Selection(this._window);
var o=a.getHtml();
var w=a.getParentElement();
if(w.tagName=="P"){o=w.outerHTML;
}var m=this._document.createElement("SPAN");
m.innerHTML=o;
if(m.getElementsByTagName("P").length>0){var h=new RegExp("<p>([\\s\\S]+?)</p>","gi");
o=o.replace(h,"$1<br/>");
if(w.tagName=="P"){w.innerHTML="";
}a.pasteHtml(o,true);
var a=new Telerik.Web.UI.Editor.Selection(this._window);
var b=a.getParentElement();
if(b.tagName=="P"){var x=b.parentNode;
while(b.childNodes.length>0){x.insertBefore(b.childNodes[0],b);
}x.removeChild(b);
}}return true;
}var o=a.getHtml();
if(o.toLowerCase().trim()=="<p>&nbsp;</p>"){return this._insertList();
}else{if(!o){var e=a.getRange();
var x=e.parentElement();
if(!x.currentStyle.hasLayout){while(!x.currentStyle.hasLayout&&x.tagName!="P"){x=x.parentNode;
}}var v=e.duplicate();
var l=e.duplicate();
var r=x.children;
var g=0;
if(r.length==0){v.moveToElementText(x);
v.collapse(true);
}else{for(g=0;
g<r.length;
g++){var q=r[g];
l.moveToElementText(q);
if(l.inRange(e)){v.moveToElementText(q);
v.collapse(true);
break;
}else{if(l.compareEndPoints("StartToStart",e)>0){if(g==0){v.moveToElementText(x);
v.collapse(true);
break;
}var j=r[g-1];
v.moveToElementText(j);
v.collapse(false);
v.move("character",1);
v.move("character",-1);
break;
}}}}var u=null;
if(g==r.length){g=0;
}for(;
g<r.length;
g++){var q=r[g];
l.moveToElementText(q);
if(l.compareEndPoints("StartToStart",e)>0){u=q;
break;
}}if(!u){u=x;
}l.moveToElementText(u);
if(u!=x){l.collapse(true);
l.move("character",-1);
l.move("character",1);
}else{l.collapse(false);
}v.setEndPoint("EndToStart",l);
v.select();
o=v.htmlText;
var s=v.parentElement();
v.execCommand("Delete",null,false);
if(v.parentElement()!=s){v.move("character",-1);
v.select();
}else{if(v.htmlText){v.text="";
if(v.parentElement()!=s){v.move("character",-1);
v.select();
}}}}}var t=o.split("<BR>");
var p="";
for(var g=0;
g<t.length;
g++){var c=t[g];
if(c){p+="<li>"+c+"</li>";
}}if(!p){return false;
}p="<"+this._listType+">"+p+"</"+this._listType+">";
a.pasteHtml(p,true);
var n=a.getParentElement();
if(n.tagName!=this._listType){n=Telerik.Web.UI.Editor.Utils.getElementParentByTag(n,this._listType);
}var f=n.nextSibling;
if(f&&f.tagName=="BR"){f.parentNode.removeChild(f);
}return true;
}};
Telerik.Web.UI.Editor.InsertListCommand.registerClass("Telerik.Web.UI.Editor.InsertListCommand",Telerik.Web.UI.Editor.CommandBase);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.TableCommandBase=function(a,b){Telerik.Web.UI.Editor.TableCommandBase.initializeBase(this,[(a||"Table Command"),b,true]);
};
Telerik.Web.UI.Editor.TableCommandsBase_Static={};
Telerik.Web.UI.Editor.TableCommandBase.prototype={getLayoutBuilderEngine:function(a,c){if(!Telerik.Web.UI.Editor.TableCommandsBase_Static._tableBuilder){Telerik.Web.UI.Editor.TableCommandsBase_Static._tableBuilder=new Telerik.Web.UI.LayoutBuilderEngine();
}var b=Telerik.Web.UI.Editor.TableCommandsBase_Static._tableBuilder;
b.set_selectedTable(a);
b.set_selectedCell(c);
return b;
},configureLayoutBuilderEngine:function(){var c=this.getSelectedCell();
if(!c){return false;
}var b=c.parentNode;
var a=this.getParentTable(b);
return this.getLayoutBuilderEngine(a,c);
},getState:function(a){return this.getSelectedCell(a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled;
},getSelectedCell:function(c){var a=new Telerik.Web.UI.Editor.Selection(c||this._window);
var b;
if(a){b=a.getParentElement();
}while(null!=b&&b.tagName!="TD"&&b.tagName!="TH"&&b.tagName!="BODY"){b=b.parentNode;
}if(!b||!b.tagName){return null;
}return(b.tagName=="TD"||b.tagName=="TH"?b:null);
},getSelectedRow:function(c){var a=new Telerik.Web.UI.Editor.Selection(c||this._window);
var b;
if(a){b=a.getParentElement();
}if(!b){return null;
}while(null!=b&&b.tagName!="TR"&&b.tagName!="BODY"){b=b.parentNode;
}return(b&&b.tagName=="TR"?b:null);
},getParentTable:function(a){if(!a){return null;
}while(null!=a&&a.parentNode!=a&&"TABLE"!=a.tagName){a=a.parentNode;
}return(a&&a.tagName=="TABLE"?a:null);
}};
Telerik.Web.UI.Editor.TableCommandBase.registerClass("Telerik.Web.UI.Editor.TableCommandBase",Telerik.Web.UI.Editor.CommandBase);
Telerik.Web.UI.Editor.TableInsertRow=function(a,c,b){Telerik.Web.UI.Editor.TableInsertRow.initializeBase(this,[(a||"Insert row"),c,true]);
this._direction=b||"above";
};
Telerik.Web.UI.Editor.TableInsertRow.prototype={clone:function(){return new Telerik.Web.UI.Editor.TableInsertRow(this._title,this._window,this._direction);
},getState:function(a){return(this.getSelectedRow(a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand(("below"==this._direction)?"insertRowBelow":"insertRowAbove");
}};
Telerik.Web.UI.Editor.TableInsertRow.registerClass("Telerik.Web.UI.Editor.TableInsertRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteRow=function(a,b){Telerik.Web.UI.Editor.TableDeleteRow.initializeBase(this,[(a||"Delete Row"),b,true]);
};
Telerik.Web.UI.Editor.TableDeleteRow.prototype={clone:function(){return new Telerik.Web.UI.Editor.TableDeleteRow(this._title,this._window);
},getState:function(a){return(this.getSelectedRow(a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand("deleteRow");
}};
Telerik.Web.UI.Editor.TableDeleteRow.registerClass("Telerik.Web.UI.Editor.TableDeleteRow",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableInsertColumn=function(a,c,b){Telerik.Web.UI.Editor.TableInsertColumn.initializeBase(this,[(a||"Insert column"),c,true]);
this._direction=b||"left";
};
Telerik.Web.UI.Editor.TableInsertColumn.prototype={clone:function(){return new Telerik.Web.UI.Editor.TableInsertColumn(this._title,this._window,this._direction);
},getState:function(a){return(this.getSelectedCell(a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){var a=this.configureLayoutBuilderEngine();
if($telerik.isRightToLeft(a._selectedTable)){this._direction=("right"==this._direction)?"left":"right";
}return a.executeCommand(("right"==this._direction)?"insertColumnToTheRight":"insertColumnToTheLeft");
}};
Telerik.Web.UI.Editor.TableInsertColumn.registerClass("Telerik.Web.UI.Editor.TableInsertColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteColumn=function(a,b){Telerik.Web.UI.Editor.TableDeleteColumn.initializeBase(this,[(a||"Delete column"),b,true]);
};
Telerik.Web.UI.Editor.TableDeleteColumn.prototype={clone:function(){return Telerik.Web.UI.Editor.TableDeleteColumn.New(this._title,this._window);
},getState:function(a){return(this.getSelectedCell(a)?Telerik.Web.UI.Editor.CommandStates.Off:Telerik.Web.UI.Editor.CommandStates.Disabled);
},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand("deleteColumn");
}};
Telerik.Web.UI.Editor.TableDeleteColumn.registerClass("Telerik.Web.UI.Editor.TableDeleteColumn",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeRows=function(a,b){Telerik.Web.UI.Editor.TableMergeRows.initializeBase(this,[(a||"Merge rows"),b,true]);
};
Telerik.Web.UI.Editor.TableMergeRows.prototype={clone:function(){return Telerik.Web.UI.Editor.TableMergeRows.New(this._title,this._window);
},getState:function(f){var b=this.getSelectedCell(f);
var a=false;
if(b){var d=b.parentNode;
var c=this.getParentTable(d);
var e=this.getLayoutBuilderEngine(c,b);
a=e.canMergeDown();
}if(a){return Telerik.Web.UI.Editor.CommandStates.Off;
}else{return Telerik.Web.UI.Editor.CommandStates.Disabled;
}},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand("mergeDown");
},getLowerCell:function(f){if(!f){return null;
}var a=this.getParentTable(f);
var d=f.parentNode;
var b=a.rows[d.rowIndex+f.rowSpan];
if(!b){return null;
}var e=b.cells[f.cellIndex];
if(!e){for(var c=b.cells.length-1;
c>=0;
c--){if(b.cells[c].offsetLeft==f.offsetLeft){return b.cells[c];
}}}return e;
}};
Telerik.Web.UI.Editor.TableMergeRows.registerClass("Telerik.Web.UI.Editor.TableMergeRows",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableMergeColumns=function(a,b){Telerik.Web.UI.Editor.TableMergeColumns.initializeBase(this,[(a||"Merge columns"),b,true]);
};
Telerik.Web.UI.Editor.TableMergeColumns.prototype={clone:function(){return Telerik.Web.UI.Editor.TableMergeColumns.New(this._title,this._window);
},getState:function(f){var b=this.getSelectedCell(f);
var a=false;
if(b){var d=b.parentNode;
var c=this.getParentTable(d);
var e=this.getLayoutBuilderEngine(c,b);
a=e.canMergeRight();
}if(a){return Telerik.Web.UI.Editor.CommandStates.Off;
}else{return Telerik.Web.UI.Editor.CommandStates.Disabled;
}},getNextSiblingCell:function(c){if(!c){return null;
}var b=c.parentNode;
var a=b.cells[c.cellIndex+1];
if(null!=a&&c.rowSpan==a.rowSpan){return a;
}else{return null;
}},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand("mergeRight");
}};
Telerik.Web.UI.Editor.TableMergeColumns.registerClass("Telerik.Web.UI.Editor.TableMergeColumns",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableSplitCell=function(a,c,b){Telerik.Web.UI.Editor.TableSplitCell.initializeBase(this,[(a||"Split cell"),c,true]);
this._direction=b||"vertical";
};
Telerik.Web.UI.Editor.TableSplitCell.prototype={clone:function(){return new Telerik.Web.UI.Editor.TableSplitCell(this._title,this._window);
},getState:function(a){return Telerik.Web.UI.Editor.CommandStates.Off;
},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand(("vertical"==this._direction)?"splitCellVertically":"splitCellHorizontally");
},getRealCellIndex:function(e){if(!e){return 0;
}var d=e.parentNode;
var c=0;
var b=0;
while(d.cells.length>c&&d.cells[c]!=e){var a=d.cells[c];
if(a.colSpan>1){b+=a.colSpan;
}else{b++;
}c++;
}return b;
}};
Telerik.Web.UI.Editor.TableSplitCell.registerClass("Telerik.Web.UI.Editor.TableSplitCell",Telerik.Web.UI.Editor.TableCommandBase);
Telerik.Web.UI.Editor.TableDeleteCell=function(a,b){Telerik.Web.UI.Editor.TableDeleteCell.initializeBase(this,[(a||"Delete cell"),b,true]);
};
Telerik.Web.UI.Editor.TableDeleteCell.prototype={clone:function(){return new Telerik.Web.UI.Editor.TableDeleteCell(this._title,this._window);
},getState:function(f){var b=this.getSelectedCell(f);
var a=false;
if(b){var d=b.parentNode;
var c=this.getParentTable(d);
var e=this.getLayoutBuilderEngine(c,b);
a=e.canDeleteCell();
}if(a){return Telerik.Web.UI.Editor.CommandStates.Off;
}else{return Telerik.Web.UI.Editor.CommandStates.Disabled;
}},onExecute:function(){var a=this.configureLayoutBuilderEngine();
return a.executeCommand("deleteCell");
}};
Telerik.Web.UI.Editor.TableDeleteCell.registerClass("Telerik.Web.UI.Editor.TableDeleteCell",Telerik.Web.UI.Editor.TableCommandBase);
Type.registerNamespace("Telerik.Web.UI");
(function(){var b=$telerik.$;
var a=Telerik.Web.UI;
a.EditorButton=function(c){a.EditorButton.initializeBase(this,[c]);
this._enabled=true;
this._text="";
this._isOn=false;
};
a.EditorButton.createToolWrapper=function(c,g){var e=document.createElement("UL");
var d=document.createElement("LI");
d.innerHTML="&nbsp;";
d.className="reGrip grip_first";
e.appendChild(d);
e.className="reToolbar "+g;
d=document.createElement("LI");
e.appendChild(d);
var f=c.get_element();
d.appendChild(f);
d=document.createElement("LI");
d.innerHTML="&nbsp;";
d.className="reGrip grip_last";
e.appendChild(d);
return e;
};
a.EditorButton.getToolRootNode=function(c){while(c&&c.tagName!="A"){c=c.parentNode;
}return c;
};
a.EditorButton._createButton=function(e){var c=document.createElement("A");
c.className=e.showText==true?"reTool_text":"reTool";
var f=e.text;
c.title=f?f:e.name;
c.href="#";
c.setAttribute("unselectable","on");
if(e.showIcon!=false){var d=document.createElement("SPAN");
d.className=e.name;
d.innerHTML="&nbsp;";
d.setAttribute("unselectable","on");
c.appendChild(d);
}if(e.showText==true){var d=document.createElement("SPAN");
d.className="reButton_text";
d.innerHTML=e.text?e.text:e.name;
d.setAttribute("unselectable","on");
c.appendChild(d);
}return c;
};
a.EditorButton.createTool=function(g,j,k,e,i){if(!k){k=a.EditorButton;
}if(!e){e=a.EditorButton._createButton(g);
if(e.tagName=="A"){var h=e;
if(k==a.EditorSplitButton||k.inheritsFrom(a.EditorSplitButton)){Sys.UI.DomElement.addCssClass(h,"reSplitButton");
var c=document.createElement("SPAN");
c.className="split_arrow";
c.innerHTML="&nbsp;";
h.appendChild(c);
}else{if(k==a.EditorDropDown||k.inheritsFrom(a.EditorDropDown)){Sys.UI.DomElement.removeCssClass(h,"reTool");
Sys.UI.DomElement.addCssClass(h,"reDropdown");
h.innerHTML="";
var c=document.createElement("SPAN");
c.innerHTML="&nbsp;";
var d=g.width?g.width:"50px";
c.style.width=d;
h.appendChild(c);
}}}}var f=$create(k,g,j,null,e);
if(i&&i.appendChild){i.appendChild(e);
}return f;
};
a.EditorButton.prototype={initialize:function(){var d=this.getAnchorElement();
if(d){d.setAttribute("unselectable","on");
}var c=this.getSpanElement();
if(c){c.setAttribute("unselectable","on");
}if(this.get_addClickHandler()){var e=this.get_element();
$addHandlers(e,{click:this.click},this);
}},dispose:function(){var c=this.get_element();
if(c){$clearHandlers(c);
}a.EditorButton.callBaseMethod(this,"dispose");
},click:function(c){this.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(c);
},add_valueSelected:function(c){this.get_events().addHandler("valueSelected",c);
},remove_valueSelected:function(c){this.get_events().removeHandler("valueSelected",c);
},raiseEvent:function(d,e){var c=this.get_events().getHandler(d);
if(c){if(!e){e=Sys.EventArgs.Empty;
}c(this,e);
}},set_width:function(c){var d=this.getSpanElement();
if(d){d.style.width=c;
}},get_width:function(){return this.get_element().offsetWidth;
},set_height:function(c){var d=this.getSpanElement();
if(d){d.style.height=c;
}},get_height:function(){return this.get_element().offsetHeight;
},isTarget:function(c){return $telerik.isDescendantOrSelf(this.get_element(),c.target);
},setState:function(c){this.set_enabled(c!=a.Editor.CommandStates.Disabled);
this.setOn(c==a.Editor.CommandStates.On);
},setFocus:function(){var c=this.getAnchorElement();
if(c&&c.focus){c.focus();
}},get_enabled:function(){return this._enabled;
},set_enabled:function(c){if(this._enabled!=c){this._enabled=c;
var d=this.getAnchorElement();
if(!this._enabled){this._addAnchorCssClass("reTool_disabled");
d.setAttribute("disabled","disabled");
}else{this._removeAnchorCssClass("reTool_disabled");
d.removeAttribute("disabled");
}}},isOn:function(){return this._isOn;
},setOn:function(c){if(this._isOn!=c){this._isOn=c;
if(this._isOn){this._addAnchorCssClass("reTool_selected");
}else{this._removeAnchorCssClass("reTool_selected");
}}},get_text:function(){if(this._text){return this._text;
}var c=this.getAnchorElement();
if(c&&c.getAttribute("title")){return c.getAttribute("title");
}return this.get_name();
},set_text:function(c){if(this._text!=c){this._text=c;
if(this.get_showText()){this.getSpanElement().innerHTML=c;
}}},_addAnchorCssClass:function(c){Sys.UI.DomElement.addCssClass(this.getAnchorElement(),c);
},_removeAnchorCssClass:function(c){Sys.UI.DomElement.removeCssClass(this.getAnchorElement(),c);
},getAnchorElement:function(){return this.get_element();
},getSpanElement:function(){var d=this.getAnchorElement();
var c=d.firstChild;
while(c!=null&&(c.tagName==null||c.tagName.toLowerCase()!="span")){c=c.nextSibling;
}return c;
}};
b.registerControlProperties(a.EditorButton,{clientStateFieldID:null,attributes:{},addClickHandler:false,autoPostBack:false,name:"",shortCut:"",showIcon:true,showText:false,skin:"",type:null,clientTypeName:"Telerik.Web.UI.EditorButton"});
b.registerControlEvents(a.EditorButton,["valueSelected"]);
a.EditorButton.registerClass("Telerik.Web.UI.EditorButton",Sys.UI.Control);
Telerik.Web.UI.EditorSpinBoxEventArgs=function(d,c){Telerik.Web.UI.EditorSpinBoxEventArgs.initializeBase(this);
this._newValue=d;
this._oldValue=c;
};
Telerik.Web.UI.EditorSpinBoxEventArgs.prototype={get_oldValue:function(){return this._oldValue;
},get_newValue:function(){return this._newValue;
}};
Telerik.Web.UI.EditorSpinBoxEventArgs.registerClass("Telerik.Web.UI.EditorSpinBoxEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.EditorSpinBox=function(c){Telerik.Web.UI.EditorSpinBox.initializeBase(this,[c]);
this._width="50px";
this._className="reSpinBox";
this._selectedItem="";
this._initialValue="";
this._visibleInput=true;
this._enabledIncrease=true;
this._enabledDecrease=true;
};
Telerik.Web.UI.EditorSpinBox.prototype={dispose:function(){this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement=null;
this._increaseButton.onclick=null;
this._increaseButton=null;
this._decreaseButton.onclick=null;
this._decreaseButton=null;
Telerik.Web.UI.EditorSpinBox.callBaseMethod(this,"dispose");
},initialize:function(){this._createControls();
},_createControls:function(){var i=document.createElement("table");
i.cellSpacing=0;
i.cellPadding=0;
i.className=this.get_visibleInput()?this._className:"reTableWizardSpinBox";
i.insertRow(-1);
var g=i.rows[0].insertCell(-1);
var f=document.createElement("INPUT");
f.className="radfd_skipme";
f.type="text";
f.onclick=function(j){this.focus();
};
f.onkeypress=Function.createDelegate(this,this._onKeyPressHandler);
f.onchange=Function.createDelegate(this,this._onChangeHandler);
this._inputElement=f;
g.appendChild(f);
if(!this.get_visibleInput()){this.set_visibleInput(false);
}if(this.get_visibleInput()){g=i.rows[0].insertCell(-1);
var e=document.createElement("table");
e.cellSpacing=0;
e.cellPadding=0;
e.insertRow(-1);
var c=e.rows[0].insertCell(-1);
var d=this._createAnchorElement("Increase");
this._increaseButton=d;
c.appendChild(d);
e.insertRow(-1);
c=e.rows[1].insertCell(-1);
d=this._createAnchorElement("Decrease");
this._decreaseButton=d;
c.appendChild(d);
g.appendChild(e);
}else{g=i.rows[0].insertCell(-1);
var d=this._createAnchorElement_noinput("Increase");
this._increaseButton=d;
g.appendChild(d);
g=i.rows[0].insertCell(-1);
d=this._createAnchorElement_noinput("Decrease");
this._decreaseButton=d;
g.appendChild(d);
}var h=this.get_element();
h.appendChild(i);
h.style.width=this.get_width();
},_createAnchorElement:function(c){var d=document.createElement("A");
var e=typeof(localization)!="undefined"&&localization[c]?localization[c]:c;
d.title=e;
d.href="javascript:void(0);";
d.innerHTML=e;
d.className="reSpinBox"+c;
d.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
return d;
},_createAnchorElement_noinput:function(c){var d=document.createElement("A");
var e=typeof(localization)!="undefined"&&localization[c]?localization[c]:c;
d.title=e;
d.href="javascript:void(0);";
d.innerHTML="<span class='reTableWizardSpinBox_"+c+"'>"+e+"</span>";
d.onclick=Function.createDelegate(this,this._onPlusMinusClickHandler);
return d;
},_executeFunction:function(g,f,d){if(d){if(f.Executed){f.Executed=false;
return $telerik.cancelRawEvent(g);
}}f.Executed=true;
var c=(this._selectedItem!="")?this._selectedItem:this._initialValue;
this._selectedItem=f.value;
var h=new Telerik.Web.UI.EditorSpinBoxEventArgs(f.value,c);
this.raiseEvent("valueSelected",h);
},_onPlusMinusClickHandler:function(g){var d=null;
if(!g){d=window.event.srcElement;
}else{d=g.target;
}while(d&&d.tagName.toLowerCase()!="a"){d=d.parentNode;
}if(!d){return;
}var c=this.get_value();
c=c.replace(/^0+(\d)/ig,"$1");
if(""==c){c="0";
}var h=parseInt(c);
var f=h+"";
if(isNaN(h)){return;
}else{f=c.substring(f.length);
}if(d==this._increaseButton){if(this._enabledIncrease){h++;
}else{return;
}}else{if(d==this._decreaseButton){if(this._enabledDecrease){h--;
}else{return;
}}else{d=null;
}}if(d&&h>=0){this.set_value(h+f);
this._executeFunction(g,this._inputElement);
}return false;
},_onChangeHandler:function(c){if(!c){c=window.event;
}this._executeFunction(c,this._inputElement);
},_onKeyPressHandler:function(c){if(!c){c=window.event;
}if(c.keyCode==13){this._executeFunction(c,this._inputElement);
return $telerik.cancelRawEvent(c);
}},_onKeyDownHandler:function(c){if(!c){var c=window.event;
}c.returnValue=this._isKeyValid(c);
},_onKeyUpHandler:function(f){if(!f){var f=window.event;
}if(this._isKeyValid(f,true)){var c=this._selectedItem;
var d=this.get_value();
var g=new Telerik.Web.UI.EditorSpinBoxEventArgs(d,c);
this.raiseEvent("valueSelected",g);
}},_isKeyValid:function(d,c){try{if(!c){c=false;
}if(!d){d=window.event;
}var g=((48<=d.keyCode&&d.keyCode<=57)||(96<=d.keyCode&&d.keyCode<=105)||(13==d.keyCode)||(8==d.keyCode)||(46==d.keyCode)||(9==d.keyCode));
if(!c){g|=((35<=d.keyCode&&d.keyCode<=40));
}return g;
}catch(f){return true;
}},get_selectedItem:function(){return this._selectedItem;
},get_value:function(){return this._inputElement.value;
},set_value:function(c){if(null==c){c="";
}this._inputElement.value=c;
if(this._initialValue==""){this._initialValue=c;
}},get_width:function(){return this._width;
},set_width:function(c){this._width=c;
var d=this.get_element();
d.style.width=this._width;
},get_enabledIncrease:function(){return this._enabledIncrease;
},set_enabledIncrease:function(c){this._enabledIncrease=c;
this._setButtonState(this._increaseButton,c);
},get_enabledDecrease:function(){return this._enabledDecrease;
},set_enabledDecrease:function(c){this._enabledDecrease=c;
this._setButtonState(this._decreaseButton,c);
},_setButtonState:function(d,c){if(!c){Sys.UI.DomElement.addCssClass(d,"disabled-button");
}else{Sys.UI.DomElement.removeCssClass(d,"disabled-button");
}},get_visibleInput:function(){return this._visibleInput;
},set_visibleInput:function(c){this._visibleInput=c;
if(this._inputElement){if(!this._visibleInput){this._inputElement.style.display="none";
}else{this._inputElement.style.display="";
}}}};
Telerik.Web.UI.EditorSpinBox.registerClass("Telerik.Web.UI.EditorSpinBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorCheckBox=function(c){Telerik.Web.UI.EditorCheckBox.initializeBase(this,[c]);
this._selectedItem=false;
};
Telerik.Web.UI.EditorCheckBox.prototype={dispose:function(){this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorCheckBox.callBaseMethod(this,"dispose");
},get_selectedItem:function(){return this._selectedItem;
},set_value:function(c){if(this._inputElement.checked!=c){this._inputElement.checked=c;
}},initialize:function(){var c=document.createElement("INPUT");
c.setAttribute("type","CHECKBOX");
c.Parent=this;
c.onclick=function(f){var d=this.Parent;
d._selectedItem=!d._selectedItem;
this.checked=d._selectedItem;
d._selectedItem=this.checked;
d.raiseEvent("valueSelected");
};
this._inputElement=c;
this.get_element().appendChild(c);
}};
Telerik.Web.UI.EditorCheckBox.registerClass("Telerik.Web.UI.EditorCheckBox",Telerik.Web.UI.EditorButton);
Telerik.Web.UI.EditorTextBox=function(c){Telerik.Web.UI.EditorTextBox.initializeBase(this,[c]);
this._width="100px";
this._selectedItem="";
};
Telerik.Web.UI.EditorTextBox.prototype={dispose:function(){this._inputElement.onchange=null;
this._inputElement.onkeypress=null;
this._inputElement.onclick=null;
this._inputElement.Parent=null;
this._inputElement=null;
Telerik.Web.UI.EditorTextBox.callBaseMethod(this,"dispose");
},get_width:function(){return this._width;
},set_width:function(c){this._width=c;
},initialize:function(){var e=document.createElement("INPUT");
e.style.width=this.get_width();
e.Parent=this;
var c=this.get_name();
var d=function(h,g,f){if(f){if(g.Executed){g.Executed=false;
return $telerik.cancelRawEvent(h);
}}g.Executed=true;
g.Parent._selectedItem=g.value;
g.Parent.raiseEvent("valueSelected");
return $telerik.cancelRawEvent(h);
};
e.onchange=function(f){if(!f){f=window.event;
}return d(f,this,true);
};
e.onclick=function(f){this.focus();
};
e.onkeypress=function(f){if(!f){f=window.event;
}if(f.keyCode==13){return d(f,this);
}};
this._inputElement=e;
this.get_element().appendChild(e);
},get_selectedItem:function(){return this._selectedItem;
},get_value:function(){return this._inputElement.value;
},set_value:function(c){if(null==c){c="";
}this._inputElement.value=c;
}};
Telerik.Web.UI.EditorTextBox.registerClass("Telerik.Web.UI.EditorTextBox",Telerik.Web.UI.EditorButton);
a.ImageDialogCaller=function(c){a.ImageDialogCaller.initializeBase(this,[c]);
};
a.ImageDialogCaller.prototype={dispose:function(){this._inputElement=null;
var c=this.get_pushButton();
if(c){c.onclick=null;
}this.set_pushButton(null);
this.set_editor(null);
a.ImageDialogCaller.callBaseMethod(this,"dispose");
},initialize:function(){var d=this.get_element();
this._inputElement=d.getElementsByTagName("INPUT")[0];
var c=d.getElementsByTagName("A")[0];
this.set_pushButton(c);
if(c){c.onclick=Function.createDelegate(this,this._onButtonClickHandler);
}},_onButtonClickHandler:function(c){this.callImageDialog();
},_dialogCallbackFunction:function(c,d){var e=d&&d.get_value?d.get_value():null;
var f="";
if(e&&e.getAttribute){f=e.getAttribute("src",2);
}if(f){this._inputElement.value=f;
this.raiseEvent("valueSelected");
}},callImageDialog:function(){var j=Function.createDelegate(this,this._dialogCallbackFunction);
var f=this.get_editor();
var k=null;
if(f){k=f.get_dialogOpener();
}else{if(a.Dialogs&&a.Dialogs.CommonDialogScript&&a.Dialogs.CommonDialogScript.get_windowReference()){k=a.Dialogs.CommonDialogScript.get_windowReference().get_dialogOpener();
}}var c=null;
if(k){var g=k.get_additionalQueryString();
var e=this._inputElement.value;
if(e){var d=e;
k.set_additionalQueryString(g+"&rndnum="+(new Date()-100)+"&PreselectedItemUrl="+encodeURIComponent(d));
var h=f?f.get_document():document;
c=h.createElement("img");
c.setAttribute("src",d);
}}var i=new a.EditorCommandEventArgs("ImageManager",null,c);
a.Editor.CommandList._getDialogArguments(i,"IMG",f,"ImageManager");
if(f){f.showDialog("ImageManager",i,j);
}else{if(k){k.open("ImageManager",i,j);
}}if(k){k.set_additionalQueryString(g);
}},get_value:function(){return this._inputElement.value;
},set_value:function(c){if(null==c){c="";
}this._inputElement.value=c;
}};
b.registerControlProperties(a.ImageDialogCaller,{pushButton:null,editor:null,width:""});
a.ImageDialogCaller.registerClass("Telerik.Web.UI.ImageDialogCaller",a.EditorButton);
})();
Type.registerNamespace("Telerik.Web.UI");
(function(){var b=$telerik.$;
var a=Telerik.Web.UI;
a.EditorDropDown=function(c){a.EditorDropDown.initializeBase(this,[c]);
this.isIE=$telerik.isIE;
this._popupVisible=false;
this._rendered=false;
this._childrenRendered=false;
this._popupElement=null;
this._itemRootElement=null;
this._onPopupClickDelegate=null;
this._onPopupMouseDownDelegate=null;
this._onPopupMouseOverDelegate=null;
this._items=[];
this._isArrayCollection=false;
this._selectedIndex=-1;
this._activeIndex=-1;
};
a.EditorDropDown.prototype={click:function(c){this.show();
return $telerik.cancelRawEvent(c);
},dispose:function(){a.EditorDropDown.callBaseMethod(this,"dispose");
this.disposeChildren();
this.detachEventHandlers();
},isExpanded:function(){return this._popupVisible;
},show:function(){if(this._popupVisible){return;
}if(this.get_clearSelectedOnShow()){this.set_selectedIndex(-1);
}var c=false;
if(!this._rendered){this.render();
c=true;
}this.raiseEvent("show");
if(!this._childrenRendered){this.renderChildren();
this._childrenRendered=true;
c=true;
}if(c){this._makeAllItemsUnselectable();
}this._show();
},configurePopupPropertiesBeforeShow:function(){this._popupBehavior.set_positioningMode(Telerik.Web.PositioningMode.BottomLeft);
},hide:function(){if(this._popupBehavior){this._popupBehavior.hide(true);
}this._popupVisible=false;
this._getPopupVisibilityController().notifyPopupClosed(this);
this.raiseEvent("hide");
},onPopupMouseOver:function(d){var c=this.resolveActiveIndex(d);
if(c>-1){this.set_activeIndex(c,d);
}$telerik.cancelRawEvent(d);
},_onPopupClick:function(d){var c=this.resolveActiveIndex(d);
$telerik.cancelRawEvent(d);
if(c>-1){this._selectedIndex=c;
this.hide();
this.raiseEvent("valueSelected");
}},get_activeIndex:function(){return this._activeIndex;
},set_activeIndex:function(c,d){this._activeIndex=c;
this.selectUIItem(d);
},selectPreviousItem:function(){var c=this.get_activeIndex();
if(c-1>=0){this.set_activeIndex(c-1);
}},selectNextItem:function(){var c=this.get_activeIndex();
if(c+1<this._items.length){this.set_activeIndex(c+1);
}},selectUIItem:function(g,h){if(!this._popupElement){return;
}var f=this._popupElement.getElementsByTagName("TD");
var j=f.length;
var d=this.get_activeIndex();
var k=null;
for(var c=0;
c<j;
c++){var l=f[c];
if(l.item_index==d){l.className="reItemOver";
k=l;
}else{if(h&&l.item_index<=d){l.className="reItemOver";
}else{l.className="";
}}}if(k&&!g){this._scrollIntoView(k);
}return k;
},_scrollIntoView:function(c){$telerik.scrollIntoView(c);
},attachEventHandlers:function(){if(!this._popupElement){return;
}this.detachEventHandlers();
this._onPopupMouseOverDelegate=Function.createDelegate(this,this.onPopupMouseOver);
$addHandler(this._popupElement,"mouseover",this._onPopupMouseOverDelegate);
this._onPopupClickDelegate=Function.createDelegate(this,this._onPopupClick);
if($telerik.isIE){$addHandler(this._popupElement,"mousedown",this._onPopupClickDelegate);
}else{$addHandler(this._popupElement,"click",this._onPopupClickDelegate);
}},detachEventHandlers:function(){if(null!=this._onPopupMouseOverDelegate){$removeHandler(this._popupElement,"mouseover",this._onPopupMouseOverDelegate);
this._onPopupMouseOverDelegate=null;
}if(null!=this._onPopupClickDelegate){if($telerik.isIE){$removeHandler(this._popupElement,"mousedown",this._onPopupClickDelegate);
}else{$removeHandler(this._popupElement,"click",this._onPopupClickDelegate);
}this._onPopupClickDelegate=null;
}},disposeChildren:function(){this._childrenRendered=false;
if(this._itemRootElement&&this._itemRootElement.parentNode){var c=this._itemRootElement;
this.renderItemRoot();
c.parentNode.replaceChild(this._itemRootElement,c);
}},render:function(){this._createUI();
this.renderHeader();
this.renderChildren();
this.renderFooter();
this._rendered=true;
this._childrenRendered=true;
},renderHeader:function(){},renderFooter:function(){},renderItemRoot:function(){this._itemRootElement=this._getTable();
return this._itemRootElement;
},renderNewRow:function(){return(this._itemRootElement.insertRow(-1));
},renderItemContainer:function(){var c=this._itemRootElement.rows[this._itemRootElement.rows.length-1];
var d=c.insertCell(-1);
return d;
},renderChildren:function(){for(var d=0;
d<this._items.length;
d++){if(0==(d%this.get_itemsperrow())){this.renderNewRow();
}var c=this.renderItemContainer();
this.markItemContainer(c,d);
this.renderChild(c,this._items[d],d);
}},renderChild:function(f,i,h){var d=document.createElement("span");
if(i){var e=null;
var g=null;
if(i instanceof Array){e=i[1];
g=i[2];
}else{e=i;
}if(g){var c=document.createElement("span");
c.innerHTML="&nbsp;";
c.className=g;
d.appendChild(c);
}if(e){d.innerHTML+=e;
d.noWrap=true;
}}f.innerHTML=d.innerHTML;
},resolveActiveIndex:function(f){var d=f.target;
var c=-1;
while(d&&d!=this._itemRootElement){if(null!=d.item_index){c=d.item_index;
break;
}d=d.parentNode;
}return c;
},markItemContainer:function(c,d){c.item_index=d;
},_makeAllItemsUnselectable:function(){if(!this._popupElement){return;
}this._popupElement.setAttribute("unselectable","on");
var e=this._popupElement.getElementsByTagName("*");
var c=e.length;
for(var d=0;
d<c;
d++){e[d].unselectable="on";
}},_show:function(){this.configurePopupPropertiesBeforeShow();
var f=this._popupElement;
var g=this.get_sizetofit();
var d=f.style.overflow;
if(g){f.style.overflowY="hidden";
}f.style.width=this.get_popupwidth();
f.style.height=this.get_popupheight();
this._itemRootElement.style.width="100%";
this._popupBehavior.show();
var c=this._getPopupChildrenHeight();
if(c!="0px"){c=this._getQuirksModeHeight(f,c);
}if(g){f.style.width=this._getPopupChildrenWidth();
f.style.height=c;
}else{var e=parseInt(c);
var h=parseInt(f.style.height);
if(e<h&&e>(h/2)){f.style.height=c;
}}this._popupBehavior.show();
this._getPopupVisibilityController().set_activePopup(this);
f.style.zIndex="100000";
if(g){f.style.overflowY=d;
}this._popupVisible=true;
},_getQuirksModeHeight:function(e,c){try{if($telerik.quirksMode){var d=$telerik.getBorderBox(e);
var f=$telerik.getPaddingBox(e);
var g=parseInt(c)+(d.top*2);
g+=f.top+f.bottom;
c=g+"px";
}}catch(i){}return c;
},_getPopupChildrenWidth:function(){var c=this.get_popupElement().childNodes;
var d=0;
for(var e=0;
e<c.length;
e++){var f=c[e].offsetWidth;
if(f&&f>d){d=f;
}}return d+"px";
},_getPopupChildrenHeight:function(){var d=this.get_popupElement().childNodes;
var c=0;
for(var e=0;
e<d.length;
e++){if(d[e].offsetHeight){c+=d[e].offsetHeight;
}}return c+"px";
},_getPopupVisibilityController:function(){return a.Editor.PopupController;
},getUniqueID:function(){if(!window.RadEditor_uniqueSeed){window.RadEditor_uniqueSeed=new Date()-101;
}if(!window.RadEditor_uniqueIdCounter){window.RadEditor_uniqueIdCounter=1;
}else{window.RadEditor_uniqueIdCounter++;
}var c=window.RadEditor_uniqueSeed-window.RadEditor_uniqueIdCounter;
return"UniqueID"+c;
},_createUI:function(){if(this._popupBehavior){return;
}var d=this.get_element();
if(!this._popupElement){var c=document.createElement("DIV");
$telerik.addCssClasses(c,[this.get_skin(),this.get_rootpopupclassname(),this.get_popupclassname()]);
this._popupElement=c;
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
document.body.appendChild(this._popupElement);
}this.renderItemRoot();
this._popupElement.appendChild(this._itemRootElement);
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{id:this.getUniqueID(),parentElement:d},null,null,this._popupElement);
this.attachEventHandlers();
},_getTable:function(){var c=document.createElement("table");
c.border=0;
c.cellPadding=0;
c.setAttribute("unselectable","on");
c.style.cursor="default";
return c;
},get_popupElement:function(){return this._popupElement;
},get_selectedItem:function(){if(this._items&&this._selectedIndex>-1){var d=this._items[this._selectedIndex];
var c=((true==this._isArrayCollection)||(d instanceof Array))?d[0]:d;
return c;
}return null;
},get_selectedIndex:function(){return this._selectedIndex;
},set_selectedIndex:function(c){this._selectedIndex=c;
this.set_activeIndex(c);
},get_items:function(){return this._items;
},set_items:function(c){this.disposeChildren();
this._items=c;
}};
b.registerControlProperties(a.EditorDropDown,{popupheight:"200px",popupwidth:"200px",rootpopupclassname:"reDropDownBody",popupclassname:"",sizetofit:false,itemsperrow:1,clearSelectedOnShow:true});
b.registerControlEvents(a.EditorDropDown,["show","hide"]);
a.EditorDropDown.registerClass("Telerik.Web.UI.EditorDropDown",a.EditorButton);
Telerik.Web.UI.EditorUpdateableDropDown=function(c){Telerik.Web.UI.EditorUpdateableDropDown.initializeBase(this,[c]);
};
Telerik.Web.UI.EditorUpdateableDropDown.prototype={updateValue:function(c){if(null==c){return;
}try{if(!c){c=this.get_text();
}var f=this.getSpanElement();
if(f){this._value=c;
f.innerHTML=(""+c).replace(/\s+/ig,"&nbsp;");
}}catch(d){}},get_value:function(){if(!this._value||this._value==this.get_text()){return"";
}return this._value;
},set_value:function(c){this.updateValue(c);
}};
Telerik.Web.UI.EditorUpdateableDropDown.registerClass("Telerik.Web.UI.EditorUpdateableDropDown",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.EditorSelfUpdateableDropDown=function(c){Telerik.Web.UI.EditorSelfUpdateableDropDown.initializeBase(this,[c]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.EditorSelfUpdateableDropDown.prototype={_onPopupClick:function(d){var c=this.resolveActiveIndex(d);
$telerik.cancelRawEvent(d);
if(c>-1){this._selectedIndex=c;
this.hide();
var f=this.get_selectedItem();
if(f){this.updateValue(f);
}this.raiseEvent("valueSelected");
}}};
Telerik.Web.UI.EditorSelfUpdateableDropDown.registerClass("Telerik.Web.UI.EditorSelfUpdateableDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorSplitButton=function(c){Telerik.Web.UI.EditorSplitButton.initializeBase(this,[c]);
this._updateHeader=true;
};
Telerik.Web.UI.EditorSplitButton.prototype={click:function(f){var d=this.isArrowClicked(f.target);
if(d||!this._updateHeader){this.show();
}else{var c=this.get_selectedItem();
if(null==c){this.show();
}else{this.raiseEvent("valueSelected");
}}return $telerik.cancelRawEvent(f);
},initialize:function(){Telerik.Web.UI.EditorSplitButton.callBaseMethod(this,"initialize");
this.set_clearSelectedOnShow(false);
},isArrowClicked:function(c){var d=this._getArrowElement();
if(c==d){return true;
}return false;
},_getArrowElement:function(){var d=this.getAnchorElement().getElementsByTagName("SPAN");
var c=d[d.length-1];
return c;
},get_updateHeader:function(){return this._updateHeader;
},set_updateHeader:function(c){this._updateHeader=c;
}};
Telerik.Web.UI.EditorSplitButton.registerClass("Telerik.Web.UI.EditorSplitButton",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.EditorToolStrip=function(c){Telerik.Web.UI.EditorToolStrip.initializeBase(this,[c]);
this._tools=[];
};
Telerik.Web.UI.EditorToolStrip.prototype={selectUIItem:function(f){for(var d=0;
d<this._items.length;
d++){var c=this._items[d];
if(d==this._activeIndex&&c.get_enabled()){c.setOn(true);
}else{c.setOn(false);
}}},set_selectedIndex:function(i){Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"set_selectedIndex",[i]);
if(this.get_updateHeader()){var f=this.get_selectedItem();
if(!f||!f.getSpanElement){return;
}var g=f.getSpanElement();
if(g){var d=g.cloneNode(true);
var h=this.getSpanElement();
var c=h.parentNode;
c.replaceChild(d,h);
var e=f.getAnchorElement();
if(e){c.setAttribute("title",e.getAttribute("title"));
}}}},hide:function(){Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"hide");
if(this.isIE){var d=this.get_selectedItem();
if(!d||!d.get_element){return;
}var c=d.get_element();
if(c){var e=c.cloneNode(true);
c.replaceNode(e);
d._element=e;
}}},show:function(){var d=this._items;
for(var e=0,f=d.length;
e<f;
e++){var c=d[e];
c.setOn(false);
}Telerik.Web.UI.EditorToolStrip.callBaseMethod(this,"show");
},_onPopupClick:function(f){var c=this._resolveSelectedTool(f);
$telerik.cancelRawEvent(f);
if(c){var d=Array.indexOf(this._items,c);
if($telerik.isSafari){this._selectedIndex=d;
this.set_activeIndex(d);
}else{this.set_selectedIndex(d);
}this.hide();
this.raiseEvent("valueSelected");
}},renderItemRoot:function(){var c=document.createElement("DIV");
c.className="reTlbVertical";
c.style.cssFloat="left";
c.style.width="100%";
this._itemRootElement=c;
return this._itemRootElement;
},renderChildren:function(){var g=this.get_itemsperrow();
var f=this.get_tools();
var j=document.createElement("UL");
j.setAttribute("onmousedown","return false;");
j.className="reToolbar "+this.get_skin();
this._itemRootElement.appendChild(j);
for(var h=0;
h<f.length;
h++){if(g>1&&h>1&&(h%this.get_itemsperrow()==0)){j=document.createElement("UL");
j.className="reToolbar "+this.get_skin();
this._itemRootElement.appendChild(j);
}var d=f[h];
if(null==d.showText){d.showText=true;
}var c=document.createElement("LI");
j.appendChild(c);
var e=Telerik.Web.UI.EditorButton.createTool(d,null,null,null,c);
this._items[this._items.length]=e;
}},_resolveSelectedTool:function(f){for(var d=0;
d<this._items.length;
d++){var c=this._items[d];
if(c.isTarget(f)){if(c.get_enabled()){return c;
}else{return null;
}}}},get_tools:function(){return this._tools;
},set_tools:function(c){this._tools=Array.clone(c);
}};
Telerik.Web.UI.EditorToolStrip.registerClass("Telerik.Web.UI.EditorToolStrip",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.EditorContextMenu=function(c){Telerik.Web.UI.EditorContextMenu.initializeBase(this,[c]);
this._parentElement=null;
this._eventObject=null;
};
Telerik.Web.UI.EditorContextMenu.prototype={initialize:function(){this.set_updateHeader(false);
this.set_clearSelectedOnShow(true);
},show:function(){this.set_activeIndex(-1);
Telerik.Web.UI.EditorContextMenu.callBaseMethod(this,"show");
},configurePopupPropertiesBeforeShow:function(){var f=this._popupBehavior;
f.set_positioningMode(Telerik.Web.PositioningMode.Absolute);
var c=this.get_parentElement();
if(c){f.set_parentElement(c);
}var d=this._eventObject;
if(d){f.set_x(d.clientX+10);
f.set_y(d.clientY+10);
}},set_eventObject:function(c){this._eventObject=c;
},get_tagName:function(){return this._tagName;
},set_tagName:function(c){this._tagName=c;
},get_parentElement:function(){return this._parentElement;
},set_parentElement:function(c){this._parentElement=c;
}};
Telerik.Web.UI.EditorContextMenu.registerClass("Telerik.Web.UI.EditorContextMenu",Telerik.Web.UI.EditorToolStrip);
})();
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.AlignmentSelector=function(a){Telerik.Web.UI.Editor.AlignmentSelector.initializeBase(this,[a]);
this._tagName="TD";
this._selectedTuple=null;
this._noAlignmentIndex=0;
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
};
Telerik.Web.UI.Editor.AlignmentSelector.prototype={initialize:function(){Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"initialize");
this.set_popupwidth("78px");
this.set_popupheight("100px");
this.set_popupclassname("reAlignmentSelector");
this.set_itemsperrow(3);
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
this.setTagName(this._tagName);
},dispose:function(){this.remove_valueSelected(this._onValueSelectedDelegate);
Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"dispose");
},_imgAlignment:[["",""],["none",""],["",""],["",""],["top",""],["",""],["left",""],["absmiddle",""],["right",""],["",""],["bottom",""],["",""]],_cellAlignment:[["",""],["none",""],["",""],["left","top"],["center","top"],["right","top"],["left","middle"],["center","middle"],["right","middle"],["left","bottom"],["center","bottom"],["right","bottom"]],_tableAlignment:[["",""],["none",""],["",""],["left",""],["center",""],["right",""],["",""],["",""],["",""],["",""],["",""],["",""]],_captionAlignment:[["",""],["none",""],["",""],["left","top"],["center","top"],["right","top"],["",""],["",""],["",""],["left","bottom"],["center","bottom"],["right","bottom"]],_alignmentClassName:["reNoAlignment","reNoAlignment","reNoAlignment","reTopLeft","reTopCenter","reTopRight","reMiddleLeft","reMiddleCenter","reMiddleRight","reBottomLeft","reBottomCenter","reBottomRight"],_getLookupTableByTagName:function(a){switch(a.toUpperCase()){case"IMG":return this._imgAlignment;
case"TABLE":return this._tableAlignment;
case"TD":return this._cellAlignment;
case"TH":return this._cellAlignment;
case"CAPTION":return this._captionAlignment;
default:return null;
}},_configureAlignmentTable:function(d){if(!this._rendered){this.render();
}var g=this._itemRootElement;
var f=0;
for(var a=0;
a<g.rows.length;
a++){var c=false;
for(var b=0;
b<g.rows[a].cells.length;
b++){var e=g.rows[a].cells[b];
var h=this._isAvailable(f++);
e.style.visibility=h?"visible":"hidden";
c|=h;
}if(null!=document.all){g.rows[a].style.display=c?"":"none";
}}},_isAvailable:function(c){var a=false;
if(this._items){var b=this._items[c];
a=((null!=b)&&(""!=b[0]||""!=b[1]));
}return a;
},renderChild:function(b,d,c){var a=document.createElement("div");
if(d){a.innerHTML="&nbsp;";
a.className=this._alignmentClassName[c];
}b.appendChild(a);
},_onDropDownValueSelected:function(){this.set_selectedIndex(this.get_selectedIndex());
},_selectAlignment:function(b,f){b=(""==b||!b)?"none":b.toUpperCase();
f=!f?"":f.toUpperCase();
if(this._items){var d=-1;
for(var e=0;
e<this._items.length;
e++){if(this._isAvailable(e)){var c=this._items[e][0].toUpperCase();
var a=this._items[e][1].toUpperCase();
if(-1==d){d=e;
}if((b==c||b==a)&&(f==c||f==a)){this.set_selectedIndex(e);
return;
}}}this.set_selectedIndex(d);
}},set_selectedIndex:function(c){Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"set_selectedIndex",[c]);
var b=this.getSpanElement();
var a=this._alignmentClassName[c];
b.className=a;
},setTagName:function(a){this._tagName=a;
this._items=this._getLookupTableByTagName(this._tagName);
this.set_selectedIndex(this._noAlignmentIndex);
},updateValue:function(a,b){this._selectAlignment(a,b);
},getAlign:function(){var b=this._items[this._selectedIndex];
var a=(b?b[0]:"");
if("none"==a){a="";
}return a;
},getVAlign:function(){var b=this._items[this._selectedIndex];
var a=(b?b[1]:"");
if("none"==a){a="";
}return a;
},show:function(){Telerik.Web.UI.Editor.AlignmentSelector.callBaseMethod(this,"show");
this._itemRootElement.cellSpacing=0;
this._configureAlignmentTable(this._tagName);
},get_clientStateFieldID:function(){return this._clientStateFieldID;
},set_clientStateFieldID:function(a){this._clientStateFieldID=a;
}};
Telerik.Web.UI.Editor.AlignmentSelector.registerClass("Telerik.Web.UI.Editor.AlignmentSelector",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.InsertTableHelper=function(a){Telerik.Web.UI.Editor.InsertTableHelper.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.InsertTableHelper.prototype={initialize:function(){var b=new Array(this.get_itemsperrow()*this.get_itemsperrow());
for(var a=0;
a<b.length;
a++){b[a]=a;
}this._items=b;
},hide:function(){},renderChild:function(b,e,d){var a=document.createElement("div");
a.innerHTML="&nbsp;";
b.appendChild(a);
var c=this._getDimensionByIndex(d);
b.setAttribute("title"," "+c.rows+" x "+c.cols+" ");
},_getDimensionByIndex:function(c){var b=0;
var a=0;
var e=this.get_itemsperrow();
for(var d=0;
d<this._items.length;
d++){if(d%e==0){b++;
a=0;
}a++;
if(c==d){break;
}}var f={rows:b,cols:a};
return f;
},get_selectedItem:function(){var a=this.get_selectedIndex();
return this._getDimensionByIndex(a);
},selectUIItem:function(g,j){var d=this._popupElement.getElementsByTagName("TD");
var k=d.length;
var c=this.get_activeIndex();
var h=this._getDimensionByIndex(c);
var f=h.cols;
for(var a=0;
a<k;
a++){var l=d[a];
var b=l.item_index;
if(b<=c&&l.cellIndex<f){l.className="reItemOver";
}else{l.className="";
}}}};
Telerik.Web.UI.Editor.InsertTableHelper.registerClass("Telerik.Web.UI.Editor.InsertTableHelper",Telerik.Web.UI.EditorDropDown);
Telerik.Web.UI.Editor.InsertTable=function(a){Telerik.Web.UI.Editor.InsertTable.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.InsertTable.prototype={initialize:function(){Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"initialize");
this._onTableHelperValueSelectedDelegate=Function.createDelegate(this,this._onTableHelperValueSelected);
this._tableHelper=null;
this._tableHelperItemsPerRow=this.get_itemsperrow();
this.set_itemsperrow(6);
this.set_popupwidth("140px");
this.set_updateHeader(false);
var a=this.get_tools();
this._longTool=a[0];
Array.removeAt(a,0);
for(var b=0;
b<a.length;
b++){a[b].showText=false;
}},show:function(){Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"show");
this._tableHelper.set_selectedIndex(-1);
},_onPopupClick:function(a){this._tableHelperClicked=false;
Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"_onPopupClick",[a]);
},_onTableHelperValueSelected:function(){this._tableHelperClicked=true;
this.set_selectedIndex(-1);
var a=this.getSpanElement();
a.className="InsertTable";
this.hide();
this.raiseEvent("valueSelected");
},get_selectedItem:function(){if(this._tableHelperClicked){return this._tableHelper.get_selectedItem();
}else{return Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"get_selectedItem");
}},renderHeader:function(){var b={skin:this.get_skin(),itemsperrow:this._tableHelperItemsPerRow,sizetofit:true};
var a={valueSelected:this._onTableHelperValueSelectedDelegate};
var c=$create(Telerik.Web.UI.Editor.InsertTableHelper,b,a,null,document.createElement("DIV"));
c.set_rootpopupclassname("");
this._tableHelper=c;
c.render();
var d=c.get_popupElement();
d.style.display="";
d.style.visibility="visible";
d.style.position="";
d.style.cssFloat="left";
var e=this.get_popupElement();
e.insertBefore(d,e.firstChild);
},renderChildren:function(){Telerik.Web.UI.Editor.InsertTable.callBaseMethod(this,"renderChildren");
var c=this._itemRootElement;
if(this._longTool){var d=document.createElement("UL");
c.insertBefore(d,c.firstChild);
this._longTool.showText=true;
var a=document.createElement("LI");
d.appendChild(a);
var b=Telerik.Web.UI.EditorButton.createTool(this._longTool,null,null,null,a);
b.get_element().style.width="auto";
this._items[this._items.length]=b;
}}};
Telerik.Web.UI.Editor.InsertTable.registerClass("Telerik.Web.UI.Editor.InsertTable",Telerik.Web.UI.EditorToolStrip);
Telerik.Web.UI.Editor.ColorPicker=function(a){Telerik.Web.UI.Editor.ColorPicker.initializeBase(this,[a]);
this._clientStateFieldID=null;
this._addCustomColorText="Add Custom Color";
};
Telerik.Web.UI.Editor.ColorPicker.prototype={initialize:function(){Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"initialize");
this.set_popupclassname("reColorPicker");
this.set_sizetofit(true);
this.set_itemsperrow(10);
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
},dispose:function(){this.remove_valueSelected(this._onValueSelectedDelegate);
Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"dispose");
},_onDropDownValueSelected:function(){var a=this.get_selectedItem();
this.set_color(a);
},get_value:function(){return this.get_color();
},set_value:function(a){this.set_color(a);
},set_color:function(b){if(!b){b="";
}var d=this.getSpanElement();
d.style.borderBottom="0px";
d.style.height="";
if(b){var a=d.offsetHeight;
if(a){d.style.height=(a-3)+"px";
}try{d.style.borderBottom="3px solid "+b;
}catch(c){}}this._color=b;
},get_color:function(){return this._color;
},onPopupMouseOver:function(b){Telerik.Web.UI.Editor.ColorPicker.callBaseMethod(this,"onPopupMouseOver",[b]);
var c=this.get_activeIndex();
var a=this._items[c];
if(null==a){return;
}if(this._infoSpan1){this._infoSpan1.innerHTML=a;
this._infoSpan1.style.backgroundColor=a;
}if(this._infoSpan2){this._infoSpan2.innerHTML=a;
this._infoSpan2.style.color=a;
}},_customColorClicked:function(d){var f=prompt(this.get_addCustomColorText(),"#");
if(f){var a=document.createElement("a");
try{a.style.borderBottom="3px solid "+f;
}catch(d){f="";
}finally{a=null;
}}if(f){this._items[this._items.length]=f;
var c=(this._items.length-1);
if(0==(c%this.get_itemsperrow())){this.renderNewRow();
}var b=this.renderItemContainer();
this.markItemContainer(b,c);
this.renderChild(b,this._items[c],c);
this.set_selectedIndex(c);
this.hide();
this.raiseEvent("valueSelected");
}$telerik.cancelRawEvent(d);
},renderFooter:function(){var d=document.createElement("div");
d.style.textAlign="center";
var e=document.createElement("a");
e.className="reCustomColor";
e.setAttribute("href","#");
e.innerHTML=this.get_addCustomColorText();
$addHandlers(e,{click:this._customColorClicked},this);
d.appendChild(e);
this.get_popupElement().appendChild(d);
var a=document.createElement("div");
a.className="reColorPickerFooter";
var c=document.createElement("span");
c.className="reDarkColor";
var b=document.createElement("span");
b.className="reLightColor";
c.innerHTML=b.innerHTML="&nbsp";
a.appendChild(c);
a.appendChild(b);
this.get_popupElement().appendChild(a);
this._infoSpan1=c;
this._infoSpan2=b;
},renderChild:function(b,d,c){var a=document.createElement("div");
if(null!=d){a.style.backgroundColor=d;
a.setAttribute("title",d);
a.innerHTML="&nbsp;";
}b.appendChild(a);
},get_clientStateFieldID:function(){return this._clientStateFieldID;
},set_clientStateFieldID:function(a){this._clientStateFieldID=a;
},get_addCustomColorText:function(){return this._addCustomColorText;
},set_addCustomColorText:function(a){this._addCustomColorText=a;
}};
Telerik.Web.UI.Editor.ColorPicker.registerClass("Telerik.Web.UI.Editor.ColorPicker",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.UndoRedoDropDown=function(a){Telerik.Web.UI.Editor.UndoRedoDropDown.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.UndoRedoDropDown.prototype={renderFooter:function(){},get_selectedItem:function(){var a=Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"get_selectedItem");
if(!a){a=1;
}return a;
},selectUIItem:function(b,a){return Telerik.Web.UI.Editor.UndoRedoDropDown.callBaseMethod(this,"selectUIItem",[b,true]);
}};
Telerik.Web.UI.Editor.UndoRedoDropDown.registerClass("Telerik.Web.UI.Editor.UndoRedoDropDown",Telerik.Web.UI.EditorSplitButton);
Telerik.Web.UI.Editor.ApplyClassDropDown=function(a){Telerik.Web.UI.Editor.ApplyClassDropDown.initializeBase(this,[a]);
this._onValueSelectedDelegate=null;
this._clientStateFieldID=null;
this._clearclasstext="Clear Class";
this._isArrayCollection=true;
};
Telerik.Web.UI.Editor.ApplyClassDropDown.prototype={initialize:function(){Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"initialize");
this.set_popupclassname("reApplyClass");
this._onValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this.add_valueSelected(this._onValueSelectedDelegate);
this._cssClassRegex=/[^\{]*\{([^\}]+)\}/gi;
},dispose:function(){this.remove_valueSelected(this._onValueSelectedDelegate);
Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"dispose");
},_onDropDownValueSelected:function(){this.updateValue(this.get_selectedItem());
},_getClassIcon:function(b){if(!b){b="";
}else{b=b.toLowerCase();
}var a=document.createElement("span");
a.innerHTML="&nbsp;"+b;
a.className="reClass_"+b;
return a;
},_getClassTag:function(d){var c=d&&d.selectorText?d.selectorText:"";
var b=c.lastIndexOf(".");
if(b==0){return"ALL";
}var a=c.lastIndexOf(" ",b);
return c.substring((a+1),b);
},_getClassCss:function(b){var c=this._cssClassRegex;
var a="";
if(null!=b.cssText){a=b.cssText;
a=a.replace(c,"$1");
}else{a=b.style.cssText;
}return a;
},_getDisplayName:function(c){if(!c||!c.selectorText){return"";
}var d=c.selectorText;
var b=d.indexOf(".");
if(-1==b){b=0;
}else{b+=1;
}var a=d.indexOf(":");
if(-1==a){a=d.length;
}return d.substring(b,a);
},_getClassName:function(d){var c=d&&d.selectorText?d.selectorText:"";
var b=c.lastIndexOf(".");
if(b==-1){return"";
}var a=c.indexOf(" ",b);
if(-1==a){a=c.indexOf(":",b);
}if(-1==a){a=c.length;
}return c.substring((b+1),a);
},_getChild:function(d,a,e){var c=document.createElement("DIV");
if(a.toLowerCase()=="a"){c=document.createElement("A");
c.href="#";
c.onmouseover="window.status = ''; return false;";
c.onclick=new Function("return false;");
c.style.cursor="default";
}if(null!=c.style.cssText){c.style.cssText=d;
}c.setAttribute("style",d);
c.innerHTML=e;
var b=c.style;
b.visibility="visible";
b.marginLeft="0px";
b.overflowX="hidden";
b.clear="none";
b.position="";
b.cssFloat="";
b.styleFloat="";
b.width="";
return c;
},set_items:function(a){Telerik.Web.UI.Editor.ApplyClassDropDown.callBaseMethod(this,"set_items",[a]);
if(this._items.length==0||this._items[0][0]!=""){this._items.splice(0,0,["",{cssText:"",selectorText:this.get_clearclasstext()}]);
}},renderChild:function(f,h,d){var a=h[1];
if(a){var c=this._getClassTag(a);
var g=this._getClassCss(a);
var e=h[2]?h[2]:this._getDisplayName(a);
f.setAttribute("title",a.selectorText);
var b=this._getClassIcon(c);
f.appendChild(b);
var i=this._getChild(g,c,e);
f.appendChild(i);
}},get_clientStateFieldID:function(){return this._clientStateFieldID;
},set_clientStateFieldID:function(a){this._clientStateFieldID=a;
},get_clearclasstext:function(){return this._clearclasstext;
},set_clearclasstext:function(a){this._clearclasstext=a;
}};
Telerik.Web.UI.Editor.ApplyClassDropDown.registerClass("Telerik.Web.UI.Editor.ApplyClassDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontNameDropDown=function(a){Telerik.Web.UI.Editor.FontNameDropDown.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.FontNameDropDown.prototype={updateValue:function(a){try{if(!a){a=this.get_text();
}if(null==a||"AZBY"==a){return;
}var c=this.getSpanElement();
if(c){this._value=(""+a).replace(/\s+/ig,"&nbsp;");
c.innerHTML=this._value;
}}catch(b){}},renderChildren:function(){var a=this._items;
if(a&&a[0]&&!(a[0] instanceof Array)){for(var b=0;
b<a.length;
b++){var c=itemName=a[b];
if(itemName=="Wingdings"||itemName=="Webdings"){itemName="Arial";
}a[b]=[c,String.format("<span style='font:normal 13px {0};'>",itemName)+c+"</span>"];
}}return Telerik.Web.UI.Editor.FontNameDropDown.callBaseMethod(this,"renderChildren");
}};
Telerik.Web.UI.Editor.FontNameDropDown.registerClass("Telerik.Web.UI.Editor.FontNameDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.FontSizeDropDown=function(a){Telerik.Web.UI.Editor.FontSizeDropDown.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.FontSizeDropDown.prototype={renderChildren:function(){var a=this._items;
if(a&&a[0]&&!(a[0] instanceof Array)){for(var b=0;
b<a.length;
b++){var c=a[b];
a[b]=[c,String.format("<font size={0}>",c)+c+"</font>"];
}}return Telerik.Web.UI.Editor.FontSizeDropDown.callBaseMethod(this,"renderChildren");
}};
Telerik.Web.UI.Editor.FontSizeDropDown.registerClass("Telerik.Web.UI.Editor.FontSizeDropDown",Telerik.Web.UI.EditorUpdateableDropDown);
Telerik.Web.UI.Editor.InsertCustomLinkDropDown=function(a){Telerik.Web.UI.Editor.InsertCustomLinkDropDown.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.prototype={renderItemRoot:function(){var a=document.createElement("UL");
a.className="reCustomLinks";
this._itemRootElement=a;
return this._itemRootElement;
},show:function(){this._linkCounter=0;
return Telerik.Web.UI.Editor.InsertCustomLinkDropDown.callBaseMethod(this,"show");
},renderChildren:function(){this.FlatLinksArray=[];
for(var b=0;
b<this._items.length;
b++){var a=this._items[b];
this._parseSubtree(a,this._itemRootElement);
}},get_selectedItem:function(){var a=this.FlatLinksArray[this.get_selectedIndex()];
return{innerHTML:a.name,href:a.href,target:a.target,title:a.toolTip};
},_parseSubtree:function(k,e){var d=this._linkCounter;
this.FlatLinksArray[d]=k;
var l=document.createElement("LI");
e.appendChild(l);
var f=k.childLinks&&k.childLinks.length;
var b=document.createElement("SPAN");
b.innerHTML="&nbsp;";
b.className=f?"reCustomLinksIcon reIcon_plus":"reCustomLinksIcon reIcon_empty";
if(f){function c(o){var q=Sys.UI.DomElement.containsCssClass(this,"reIcon_plus");
var p=this.parentNode.getElementsByTagName("UL")[0];
if(p){p.style.display=q?"":"none";
var i=q?"reIcon_plus":"reIcon_minus";
var n=q?"reIcon_minus":"reIcon_plus";
Sys.UI.DomElement.removeCssClass(this,i);
Sys.UI.DomElement.addCssClass(this,n);
}return false;
}$addHandler(b,"click",c);
}l.appendChild(b);
var g=null;
if(k.href){g=document.createElement("A");
g.href="#";
g.innerHTML=k.name;
l.appendChild(g);
this.markItemContainer(g,this._linkCounter);
}else{g=document.createElement("SPAN");
g.innerHTML=k.name;
l.appendChild(g);
}this._linkCounter++;
if(f){var j=document.createElement("UL");
l.appendChild(j);
var m=k.childLinks;
for(var a=0;
a<k.childLinks.length;
a++){var h=m[a];
this._parseSubtree(h,j);
}j.style.display="none";
}}};
Telerik.Web.UI.Editor.InsertCustomLinkDropDown.registerClass("Telerik.Web.UI.Editor.InsertCustomLinkDropDown",Telerik.Web.UI.EditorDropDown);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor._PopupController=function(){this._activePopup=null;
this._registerGlobalBodyEventHandlers();
};
Telerik.Web.UI.Editor._PopupController.prototype={_registerGlobalBodyEventHandlers:function(){function a(c,f){var h=window.frames;
for(var d=0;
d<h.length;
d++){var g=null;
try{g=h[d].window.document;
}catch(j){}if(!g){continue;
}try{if(false!=c){f.attachToDocument(g);
}else{f.detachFromDocument(g);
}}catch(j){}}}var b=Function.createDelegate(null,function(c){if(c.keyCode==27){Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}});
$telerik.addExternalHandler(document.body,"keydown",b);
a(true,this);
$telerik.addExternalHandler(document.body,"mousedown",this._hideHandler);
Sys.Application.add_unload(function(){a(false,Telerik.Web.UI.Editor.PopupController);
$telerik.removeExternalHandler(document.body,"mousedown",Telerik.Web.UI.Editor.PopupController._hideHandler);
$telerik.removeExternalHandler(document.body,"keydown",b);
});
},attachToDocument:function(a){$telerik.addExternalHandler(a,"mousedown",this._hideHandler);
},detachFromDocument:function(b){try{$telerik.removeExternalHandler(b,"mousedown",this._hideHandler);
}catch(a){}},_hideHandler:function(a){Telerik.Web.UI.Editor.PopupController._hideIfOutsidePopup(a);
},hideActivePopup:function(){if(this._activePopup!=null){this._activePopup.hide();
this._activePopup=null;
}},_hideIfOutsidePopup:function(b){if(this._activePopup!=null){if(!this._activePopup.get_popupElement){return;
}var a=this._activePopup.get_popupElement();
if(!this._isMouseOverElement(b,a)){this.hideActivePopup();
}}},_isMouseOverElement:function(g,f){var b=null;
try{b=$telerik.getBounds(f);
}catch(g){return false;
}if(g&&g.target&&g.target.tagName=="SELECT"&&g.clientX<0){return true;
}var a=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;
var d=g.clientX-2+a.scrollLeft;
var c=g.clientY-2+a.scrollTop;
return $telerik.containsPoint(b,d,c);
},notifyPopupClosed:function(a){if(this._activePopup==a){this._activePopup=null;
}},set_activePopup:function(a){if(this._activePopup&&(a!=this._activePopup)){this._activePopup.hide();
}this._activePopup=a;
},get_activePopup:function(){return this._activePopup;
}};
Telerik.Web.UI.Editor._PopupController.registerClass("Telerik.Web.UI.Editor._PopupController",null);
if(!Telerik.Web.UI.Editor.PopupController){var createEditorPopupController=function(){window.setTimeout(function(){Telerik.Web.UI.Editor.PopupController=new Telerik.Web.UI.Editor._PopupController();
},100);
};
createEditorPopupController();
}Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.DefaultToolAdapter=function(a){Telerik.Web.UI.Editor.DefaultToolAdapter.initializeBase(this,[a]);
this._editor=null;
this._toolJSON=[];
this._tools=[];
this._contextMenusEnabled=true;
this.isIE=$telerik.isIE;
this._editorIEFirstShow=false;
};
Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=null;
Telerik.Web.UI.Editor.DefaultToolAdapter.prototype={initialize:function(){this._onEditorSelectionChangeDelegate=Function.createDelegate(this,this._onEditorSelectionChange);
this._onEditorModeChangeDelegate=Function.createDelegate(this,this._onEditorModeChange);
this._onToolAdapterClickDelegate=Function.createDelegate(this,this._onToolBarClick);
this._onToolAdapterKeyDownDelegate=Function.createDelegate(this,this._onKeyDownHandler);
this._onDropDownValueSelectedDelegate=Function.createDelegate(this,this._onDropDownValueSelected);
this._onDropDownBeforeShowDelegate=Function.createDelegate(this,this._onDropDownBeforeShow);
this._onDropDownHideDelegate=Function.createDelegate(this,this._onDropDownHide);
this._initContextMenus();
this._registerEditorHandlers();
var b=Telerik.Web.UI.EditorToolbarMode;
var a=this.get_editor();
switch(a.get_toolbarMode()){case b.Default:a.add_firstShow(Function.createDelegate(this,function(){this._hookToolbarJson2Html();
var d=this.get_editor();
var c=d.get_element().style.height;
d._updateEditorSize(c);
}));
break;
case b.Floating:this._createFloatingButton();
break;
case b.PageTop:case b.ShowOnFocus:this._hookToolbarModeEventHandlers();
break;
}},_hookToolbarJson2Html:function(){if(this._initializedToolbars){return;
}this._initializedToolbars=true;
var h=this.get_toolJSON();
var d=this._getToolBarElements();
var k=[];
for(var a=0;
a<h.length;
a++){var l=h[a];
var c=d[a];
this._initializeToolbar(l,c);
var n=l.attributes;
var j=n?n.dockingzone:null;
if(j){k[k.length]=[j,c];
}}if($telerik.isIE){var m=this.get_element();
m.style.height="";
}var f=this.get_editor();
var b=f.get_id();
for(var a=0;
a<k.length;
a++){var e=k[a][0];
var j=e.charAt(0).toUpperCase()+e.substring(1);
var g=$get(b+j);
if(!g){g=$get(e);
}if(g){if(g.innerHTML=="&nbsp;"){g.innerHTML="";
}g.appendChild(k[a][1]);
}}},_initNonDefaultToolbarMode:function(){var e=this.get_editor();
var c=Telerik.Web.UI.EditorToolbarMode;
var d=e.get_toolbarMode();
var b=this._toolbarHolder;
var a=Telerik.Web.UI.WindowBehaviors;
switch(d){case c.ShowOnFocus:b.set_behaviors(a.None);
b.set_visibleTitlebar(false);
break;
case c.PageTop:b.set_behaviors(a.None);
b.set_visibleTitlebar(false);
break;
default:b.set_behaviors(a.Move+a.Close+a.Pin);
break;
}this.get_element().style.visibility="visible";
},_showToolbarHolder:function(a){if(!a){if(this._toolbarHolder){this._toolbarHolder.hide();
}return;
}else{if($telerik.isIE&&!this._editorIEFirstShow){if(this.get_editor().get_toolbarMode()!=Telerik.Web.UI.EditorToolbarMode.Floating){this._editorIEFirstShow=true;
return;
}}}if(this.get_editor().isFullScreen()){return;
}var b=Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper;
if(b==this&&b._toolbarHolder&&b._toolbarHolder.isVisible()){b.get_toolbarHolder().setActive(true);
return;
}if(b&&b._showToolbarHolder){b._showToolbarHolder(false);
}Telerik.Web.UI.Editor.DefaultToolAdapter._visibleWrapper=this;
this.get_window();
this._initNonDefaultToolbarMode();
this._toolbarHolder.show();
},_positionWindow:function(){var c=Telerik.Web.UI.EditorToolbarMode;
var a=this.get_editor();
var b=a.get_toolbarMode();
if(b==c.ShowOnFocus){this._positionToolbarAboveEditor();
}else{if(b==c.PageTop){this._positionOnPageTop();
}else{if(b==c.Floating){if(!this._wasShown){this._positionToolbarAboveEditor();
this._wasShown=true;
}}}}},get_window:function(){if(!this._toolbarHolder){var e=this.get_editor();
var d=e.get_dialogOpener();
if(!d){return;
}var a=d.get_container().clone(e.get_id()+"_toolbarMode");
a.set_visibleStatusbar(false);
var c=this.get_element();
var b=c.offsetWidth;
a.setSize(b+10,"");
a.add_show(Function.createDelegate(this,function(f,h){var k=f.get_contentElement();
if(!k){return;
}var l=f.get_popupElement();
l.style.zIndex="10000";
f.setActive(true);
Sys.UI.DomElement.addCssClass(l,"reToolbarWindow");
this._hookToolbarJson2Html();
k.style.overflow="";
k.style.height="";
var i=k.offsetWidth;
k.style.width=i+"px";
var j=e.get_toolsWidth();
if(!j){var g=f.getWindowBounds();
j=g.width;
}f.setSize(j,null);
k.style.width="100%";
this._positionWindow();
}));
this._toolbarHolder=a;
this._moveToolbarsToEditor(false);
}return this._toolbarHolder;
},_moveToolbarsToEditor:function(b){var e=this.get_element();
if(!b){if(!this._fakeToolbarParentCreated){var a=e.ownerDocument.createElement("DIV");
a.control=e.control;
e.parentNode.appendChild(a);
this._fakeToolbarParentCreated=true;
e.control=null;
var c=a.style;
c.height=c.fontSize=c.lineHeight="1px";
c.border="1px solid red";
c.visibility="hidden";
if(!$telerik.isIE){c.display="none";
}}var d=this.get_toolbarHolder();
d.set_contentElement(e);
e.style.width="100%";
}else{e.style.width="";
var f=this.get_editor().get_TopZone();
f.appendChild(e);
}},_positionToolbarAboveEditor:function(){var c=this._toolbarHolder;
var f=this.get_editor();
var d=$telerik.getBounds(f.get_element());
var a=d.x;
var b=$telerik.getBounds(c.get_popupElement()).height;
var e=d.y-b;
c.moveTo(a,e);
},_positionOnPageTop:function(){var c=this._toolbarHolder;
var a=c._getViewportBounds();
var e=a.scrollLeft;
var b=a.scrollTop;
c.moveTo(e,b);
var d=this.get_editor().get_toolsWidth();
if(d&&d.indexOf("%")==-1){c.set_width(d);
}else{c.set_width("");
}if(!c.isPinned()){c.togglePin();
}},_createFloatingButton:function(){this._onToggleFloatingToolbarDelegate=Function.createDelegate(this,this._onToggleFloatingToolbar);
var g=this.get_editor();
var f=g.get_skin();
var d={name:"ToggleFloatingToolbar",addClickHandler:true,skin:f};
var a={valueSelected:this._onToggleFloatingToolbarDelegate};
var b=Telerik.Web.UI.EditorButton.createTool(d,a);
var e=Telerik.Web.UI.EditorButton.createToolWrapper(b,f);
var c=$get(g.get_id()+"Top");
if(c){c.appendChild(e);
}},_onToggleFloatingToolbar:function(){var a=!this._toolbarHolder||!this._toolbarHolder.isVisible();
this._showToolbarHolder(a);
},_hookToolbarModeEventHandlers:function(){var a=this;
var c=function(){a._showToolbarHolder(true);
};
var b=this.get_editor();
if(b.isIE){this.get_editor().add_editReady(function(){b.attachEventHandler("beforeeditfocus",c);
});
}else{b.add_selectionChange(c);
}b.add_modeChange(function(){a._showToolbarHolder(a.get_editor().get_mode()==Telerik.Web.UI.EditModes.Design);
});
b.add_submit(function(){a._showToolbarHolder(false);
});
b.add_toggleScreenMode(function(){var d=a.get_editor().isFullScreen();
a._moveToolbarsToEditor(d);
var e=a.get_toolbarHolder();
if(d){e.hide();
}else{e.show();
}});
this._bodyClickDelegate=Function.createDelegate(this,this._onBodyClick);
$telerik.addExternalHandler(document.body,"click",this._bodyClickDelegate);
},_disposeToolbarModeHandlers:function(){if(this._bodyClickDelegate){$telerik.removeExternalHandler(document.body,"click",this._bodyClickDelegate);
this._bodyClickDelegate=null;
}},onContextMenu:function(d){if(!this._contextMenusEnabled){return;
}var f=this.get_editor();
if(f.get_mode()!=Telerik.Web.UI.EditModes.Design){return;
}this.createContextMenus();
var b=d.srcElement?d.srcElement:d.target;
var i=b.tagName;
var c=this._contextMenus[i];
if("TH"==i&&!c){c=this._contextMenus.TD;
}var a="";
if(!c){var h=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"A");
if(!h){h=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"TD");
}if(!h){h=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"TABLE");
}if(h){a=h.tagName;
b=h;
}else{a="*";
}c=this._contextMenus[a];
}if(c&&i=="IMG"&&b&&"true"==b.getAttribute("isflash")){c=null;
}if(!this.isIE&&a=="*"){return;
}if(c){c.set_eventObject(d);
c.show();
if($telerik.isSafari){try{f.selectElement(b);
}catch(g){}}}return $telerik.cancelRawEvent(d);
},enableContextMenus:function(a){this._contextMenusEnabled=a;
},_initContextMenus:function(){var a=Function.createDelegate(this,this.onContextMenu);
var b=this.get_editor();
b.add_editReady(function(){b.attachEventHandler("contextmenu",a);
});
},createContextMenus:function(){if(this._contextMenus){return;
}this._contextMenus={};
var f=this.get_editor();
var h=f.get_skin();
var d=f.get_contextMenusJSON();
var e={valueSelected:this._onDropDownValueSelectedDelegate,show:this._onDropDownBeforeShowDelegate,hide:this._onDropDownHideDelegate};
for(var a=0;
a<d.length;
a++){var g=d[a];
g.sizetofit=true;
g.parentElement=f.get_contentAreaElement();
g.skin=h;
var c=$create(Telerik.Web.UI.EditorContextMenu,g,e,null,document.createElement("SPAN"));
var b=g.tagName?g.tagName:"*";
this._contextMenus[b]=c;
}},dispose:function(){var b=this._getToolBarElements();
for(var c=0;
c<b.length;
c++){$clearHandlers(b[c]);
}this._tools=[];
this._disposeToolbarModeHandlers();
var a=this._toolbarHolder;
if(a&&a.dispose){a.dispose();
}Telerik.Web.UI.Editor.DefaultToolAdapter.callBaseMethod(this,"dispose");
},setFocus:function(){var a=this._tools[0];
window.setTimeout(function(){if(a){a.setFocus();
}},100);
return false;
},getContextMenuByTagName:function(a){this.createContextMenus();
return this._contextMenus[a];
},getToolByName:function(a){for(var c=0;
c<this._tools.length;
c++){var b=this._tools[c];
if(b&&b.get_name()==a){return b;
}}return null;
},setToolState:function(b,c){if(!b){b=this._tools;
}var g=this.get_editor();
for(var e=0;
e<b.length;
e++){var a=b[e];
var d=a.get_name();
if(a.setState){var f=c;
if(null==f){f=g.getToolState(d);
}if(null!=f){a.setState(f);
}}if(a.updateValue){a.updateValue(g.getToolValue(d));
}}},_convertCommandsArray:function(e){var f=[];
for(var c=0;
c<e.length;
c++){var a=e[c];
var b=(c+1)+". "+a.get_title();
if(a.get_argument){var d=a.get_argument();
if(d){b+=' ["'+d+'"]';
}}f[c]=[c+1,b];
}return f;
},_onDropDownHide:function(a,b){var c=this.get_editor();
c.enableContentArea(true);
},_onDropDownBeforeShow:function(f,n){var l=this.get_editor();
if(Telerik.Web.UI.EditorToolStrip.isInstanceOfType(f)){this.setToolState(f.get_items());
}if(!l.getSelection().isControl()&&!Telerik.Web.UI.EditorContextMenu.isInstanceOfType(f)){l.enableContentArea(false);
}var e=f.get_name();
if(e=="Undo"){var o=l.get_commandsManager().getCommandsToUndo();
o=this._convertCommandsArray(o);
f.set_items(o);
}else{if(e=="Redo"){var h=l.get_commandsManager().getCommandsToRedo();
h=this._convertCommandsArray(h);
f.set_items(h);
}else{if(e=="ModuleManager"){var c=l.get_modulesManager();
if(!c){return;
}var j=c.get_modules();
var m=[];
for(var a=0;
a<j.length;
a++){var g=j[a];
var k=g.get_name();
var p=g.get_title();
if(!p){p=k;
}cssClass=g.get_visible()?"reModule_visible_icon":"reModule_hidden_icon";
m[a]=[k,p,cssClass];
}f.set_updateHeader(false);
f.set_items(m);
}}}var b=f.get_items();
if(b&&b.length>0){return;
}var d=null;
switch(e){case"ApplyClass":d=l.getCssArray();
break;
case"FontName":d=l.get_fontNames();
break;
case"FontSize":d=l.get_fontSizes();
break;
case"InsertSymbol":d=l.get_symbols();
break;
case"BackColor":case"ForeColor":d=l.get_colors();
break;
case"RealFontSize":d=l.get_realFontSizes();
break;
case"InsertSnippet":d=l.get_snippets();
break;
case"Zoom":d=["10%","20%","50%","100%","150%","200%","300%","500%"];
break;
case"FormatBlock":d=l.get_paragraphs();
break;
case"InsertCustomLink":d=l.get_links();
break;
case"AjaxSpellCheck":case"SpellCheck":d=l.get_languages();
break;
}if(d){f.set_items(d);
}},_initializeToolbar:function(s,j){var p=j.getElementsByTagName("li");
var r=s.tools;
var a=this.get_editor();
var m=a.get_skin();
var h=0;
if(r){var q=0;
var y=r.length;
for(var o=0;
o<y;
o++){var k=p[o+1];
var w=k.firstChild;
q+=k.offsetWidth;
var b=r[o];
var d=b.type;
var e=b.name;
var u=Telerik.Web.UI.EditorToolType;
var l=Telerik.Web.UI.EditorButton;
var x=null;
var f=false;
if(d){switch(d){case u.Button:break;
case u.Separator:if(!h){h+=parseInt($telerik.getCurrentStyle(k,"marginLeft"));
h+=parseInt($telerik.getCurrentStyle(k,"marginRight"));
}q+=h;
l=null;
break;
case u.DropDown:l=Telerik.Web.UI.EditorDropDown;
if(e=="FontName"){l=Telerik.Web.UI.Editor.FontNameDropDown;
}else{if(e=="FontSize"){l=Telerik.Web.UI.Editor.FontSizeDropDown;
}else{if(e=="FormatBlock"||e=="RealFontSize"||e=="Zoom"){l=Telerik.Web.UI.EditorUpdateableDropDown;
}else{if(e=="ApplyClass"){l=Telerik.Web.UI.Editor.ApplyClassDropDown;
}else{if(e=="InsertCustomLink"){l=Telerik.Web.UI.Editor.InsertCustomLinkDropDown;
}}}}}f=true;
break;
case u.SplitButton:l=Telerik.Web.UI.EditorSplitButton;
if(e=="ForeColor"||e=="BackColor"){l=Telerik.Web.UI.Editor.ColorPicker;
b.addCustomColorText=a.getLocalizedString("AddCustomColor");
}else{if(e=="Undo"||e=="Redo"){l=Telerik.Web.UI.Editor.UndoRedoDropDown;
}}f=true;
break;
case u.ToolStrip:l=Telerik.Web.UI.EditorToolStrip;
if(e=="InsertTable"){l=Telerik.Web.UI.Editor.InsertTable;
}f=true;
break;
case u.Custom:break;
}}if(b.attributes){for(var t in b.attributes){b[t.toLowerCase()]=b.attributes[t];
}}if(l){var g=null;
if(f){g={valueSelected:this._onDropDownValueSelectedDelegate,show:this._onDropDownBeforeShowDelegate,hide:this._onDropDownHideDelegate};
b.skin=m;
}x=$create(l,b,g,null,w);
}if(x){Array.add(this._tools,x);
var v=x.get_shortCut();
if(v){var c=x.get_name();
if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(x)&&c!="Undo"&&c!="Redo"){c="reToolAdapter_"+c;
Telerik.Web.UI.Editor.CommandList[c]=this._toolAdapterDropDownExpander;
}a.setShortCut(c,v);
}}}var n=j;
if(this.isIE&&n&&q){n.style.width=(q+(p[0].offsetWidth)*2)+"px";
}if($telerik.isSafari){n.setAttribute("onmousedown","return false;");
}$addHandlers(j,{click:this._onToolAdapterClickDelegate,keydown:this._onToolAdapterKeyDownDelegate},this);
}},_toolAdapterDropDownExpander:function(a,c){var b=c.getToolByName(a.replace("reToolAdapter_",""));
b.setFocus();
b.show();
b.selectNextItem();
return false;
},_onEditorModeChange:function(a,b){var c=Telerik.Web.UI.EditModes;
var d=a.get_mode();
this._setEnabled((d==c.Design));
},_onEditorSelectionChange:function(a,b){this.setToolState();
},_setEnabled:function(d){var b=this._tools;
for(var c=0;
c<b.length;
c++){var a=b[c];
a.set_enabled(d);
}},_registerEditorHandlers:function(){var a=this.get_editor();
a.add_selectionChange(this._onEditorSelectionChangeDelegate);
a.add_modeChange(this._onEditorModeChangeDelegate);
},_onBodyClick:function(){if(this._preventToolbarFromHiding){this._preventToolbarFromHiding=false;
return;
}this._showToolbarHolder(false);
},_onDropDownValueSelected:function(c,b){this._preventToolbarFromHiding=true;
var a=c.get_selectedItem();
if(Telerik.Web.UI.EditorButton.isInstanceOfType(a)){this._raiseEditorEvent(a,null);
}else{this._raiseEditorEvent(c,a);
}},_onKeyDownHandler:function(f){var c=f.keyCode;
if(9==c||37==c||39==c||121==c){if(Telerik.Web.UI.Editor.PopupController){Telerik.Web.UI.Editor.PopupController.hideActivePopup();
}}if(121==c){var g=this.get_editor();
window.setTimeout(function(){if(g){g.setFocus();
}},100);
if(f.rawEvent){$telerik.cancelRawEvent(f.rawEvent);
}return $telerik.cancelRawEvent(f);
}if(9==c){return;
}var a=this._getSelectedTool(f);
if(!Telerik.Web.UI.EditorButton.isInstanceOfType(a)){return;
}if(37==c||39==c){var b=a;
while(true){b=(37==c)?this._getPreviousTool(b):this._getNextTool(b);
if(null==b){break;
}if(b.get_enabled()){break;
}}if(b&&b.get_enabled()){b.setFocus();
}}if(13==c&&a&&!a.get_selectedItem){this._raiseEditorEvent(a,null);
return;
}if(!Telerik.Web.UI.EditorDropDown.isInstanceOfType(a)){return;
}if(38==c||40==c){var d=false;
if(!a.isExpanded()){a.show();
d=true;
}if(d||40==c){a.selectNextItem();
}else{a.selectPreviousItem();
}}else{if(13==c){a.hide();
if(a.get_activeIndex){a.set_selectedIndex(a.get_activeIndex());
}this._onDropDownValueSelected(a);
}else{if(27==c){a.hide();
}}}},_onToolBarClick:function(b){var a=this._getSelectedTool(b);
if(a){if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(a)){a.click(b);
}else{if(false){}else{this._raiseEditorEvent(a);
}}}$telerik.cancelRawEvent(b);
},_raiseEditorEvent:function(c,a){var b=this.get_events().getHandler("ToolClick");
if(b){var e=c.get_name?c.get_name():"";
var d=new Telerik.Web.UI.EditorCommandEventArgs(e,c,a);
b(c,d);
}},_getPreviousTool:function(a){var b=Array.indexOf(this._tools,a);
return this._tools[b-1];
},_getNextTool:function(a){var b=Array.indexOf(this._tools,a);
return this._tools[b+1];
},_getSelectedTool:function(c){var b=Telerik.Web.UI.EditorButton.getToolRootNode(c.target);
if(null==b){return;
}var a=b.control;
if(null==a){return;
}if(a.get_enabled&&a.get_enabled()==false){return;
}if(c&&a){c.preventDefault();
c.stopPropagation();
}return a;
},_getToolBarElements:function(){var b=this.get_element();
var a=b.getElementsByTagName("ul");
return a;
},get_tools:function(){return this._tools;
},get_toolbarHolder:function(){return this.get_window();
},get_editor:function(){return this._editor;
},set_editor:function(a){if(this._editor!=a){this._editor=a;
}},get_toolJSON:function(){return this._toolJSON;
},set_toolJSON:function(a){this._toolJSON=a;
},add_toolClick:function(a){this.get_events().addHandler("ToolClick",a);
},remove_toolClick:function(a){this.get_events().removeHandler("ToolClick",a);
}};
Telerik.Web.UI.Editor.DefaultToolAdapter.registerClass("Telerik.Web.UI.Editor.DefaultToolAdapter",Sys.UI.Control);
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
with(Telerik.Web.UI.Editor){Telerik.Web.UI.Editor.UpdateCommandsArray={InsertOrderedList:new BrowserCommand(null,null,"InsertOrderedList"),InsertUnorderedList:new BrowserCommand(null,null,"InsertUnorderedList"),Unlink:new BrowserCommand(null,null,"Unlink"),Bold:new BrowserCommand(null,null,"Bold"),Italic:new BrowserCommand(null,null,"Italic"),Underline:new BrowserCommand(null,null,"Underline"),FontName:new BrowserCommand(null,null,"FontName"),FontSize:new BrowserCommand(null,null,"FontSize"),Paste:new BrowserCommand(null,null,"Paste"),Cut:new BrowserCommand(null,null,"Cut"),Copy:new BrowserCommand(null,null,"Copy"),JustifyLeft:new BrowserCommand(null,null,"JustifyLeft"),JustifyRight:new BrowserCommand(null,null,"JustifyRight"),JustifyCenter:new BrowserCommand(null,null,"JustifyCenter"),JustifyNone:new BrowserCommand(null,null,"JustifyNone"),JustifyFull:new BrowserCommand(null,null,"JustifyFull"),Indent:new BrowserCommand(null,null,"Indent"),Outdent:new BrowserCommand(null,null,"Outdent"),Subscript:new BrowserCommand(null,null,"Subscript"),Superscript:new BrowserCommand(null,null,"Superscript"),StrikeThrough:new BrowserCommand(null,null,"StrikeThrough"),AbsolutePosition:new BrowserCommand(null,null,"AbsolutePosition"),FormatBlock:new FormatBlockCommand(null,null,null),InsertRowAbove:new TableInsertRow(null,null,"above"),InsertRowBelow:new TableInsertRow(null,null,"below"),InsertColumnLeft:new TableInsertColumn(null,null,"left"),InsertColumnRight:new TableInsertColumn(null,null,"right"),DeleteRow:new TableDeleteRow(null,null),DeleteColumn:new TableDeleteColumn(null,null),DeleteCell:new TableDeleteCell(null,null),MergeColumns:new TableMergeColumns(null,null),MergeRows:new TableMergeRows(null,null),SplitCell:new TableSplitCell(null,null,"vertical"),SplitCellHorizontal:new TableSplitCell(null,null,"horizontal"),ApplyClass:new ClassNameCommand(null,null)};
}Telerik.Web.UI.Editor.CommandList=new (function(){this.getCallbackFunction=function(a,b){return(a&&a._callbackFunction&&typeof(a._callbackFunction)=="function")?a._callbackFunction:b;
};
this.AjaxSpellCheck=function(b,g,c){function e(){if(!g.get_ajaxSpellCheck()){var m={editor:g};
var l=document.createElement("DIV");
var i=$create(Telerik.Web.UI.Editor.AjaxSpellCheck,m,null,null,l);
var j=i.get_element();
var h=$get(g.get_id()+"Top");
if(h){h.appendChild(j);
}g.set_ajaxSpellCheck(i);
}var k=g.get_ajaxSpellCheck();
if(c&&c.value){k.set_language(c.value);
}k.spellCheck();
}if(typeof(Telerik.Web.UI.Editor.AjaxSpellCheck)=="undefined"){function d(j,i){var h=j.get_responseData();
$telerik.evalScriptCode(h);
e();
}var a=g.get_ajaxSpellCheckScriptReference();
var f=new Sys.Net.WebRequest();
f.set_url(a);
f.set_httpVerb("GET");
f.add_completed(d);
f.invoke();
}else{e();
}return false;
};
this.ModuleManager=function(b,f,c){var e=c.value;
var d=f.get_modulesManager();
if(!d){return false;
}var a=d.getModuleByName(e);
if(a){a.toggleVisibility();
f._updateEditorSize(null,true);
}return false;
};
this.ToggleScreenMode=function(a,c,b){c.toggleScreenMode();
return false;
};
this.InsertRowAbove=this.InsertRowBelow=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableInsertRow(c.getLocalizedString(a),null,a=="InsertRowAbove"?"above":"below"));
};
this.InsertColumnLeft=this.InsertColumnRight=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableInsertColumn(c.getLocalizedString(a),null,a=="InsertColumnLeft"?"left":"right"));
};
this.DeleteRow=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableDeleteRow(c.getLocalizedString(a)));
};
this.DeleteColumn=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableDeleteColumn(c.getLocalizedString(a)));
};
this.DeleteCell=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableDeleteCell(c.getLocalizedString(a)));
};
this.MergeColumns=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableMergeColumns(c.getLocalizedString(a)));
};
this.MergeRows=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableMergeRows(c.getLocalizedString(a)));
};
this.SplitCell=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(c.getLocalizedString(a),null,"vertical"));
};
this.SplitCellHorizontal=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.TableSplitCell(c.getLocalizedString(a),null,"horizontal"));
};
this.DeleteTable=function(b,d,c){var a=c.value;
if(!a){a=d.getSelectedElement();
}if(a&&"TABLE"!=a.tagName){a=Telerik.Web.UI.Editor.Utils.getElementParentByTag(a,"TABLE");
}if(a){d.selectElement(a);
d.executeBrowserCommand("Delete");
}};
this.InsertFormForm=this.InsertFormButton=this.InsertFormCheckbox=this.InsertFormHidden=this.InsertFormImageButton=this.InsertFormPassword=this.InsertFormRadio=this.InsertFormReset=this.InsertFormSelect=this.InsertFormSubmit=this.InsertFormTextarea=this.InsertFormText=function(a,e,b){var d=a.substring(10);
var c=new Telerik.Web.UI.EditorCommandEventArgs(a,b.get_tool(),d);
e.fire("InsertFormElement",c);
};
this.StripAll=this.StripCss=this.StripFont=this.StripSpan=this.StripWord=function(a,e,b){var d=a.substring(5);
var c=new Telerik.Web.UI.EditorCommandEventArgs(a,b.get_tool(),d.toUpperCase());
e.fire("FormatStripper",c);
};
this.FormatStripper=function(h,a,k){var n=k.value;
var b=a._filtersManager.getFilterByName("ConvertFontToSpanFilter");
if(a.get_mode()==Telerik.Web.UI.EditModes.Design&&n=="SPAN"&&b&&b.get_enabled()){n="FONT";
}var m="";
try{m=a.getSelectionHtml();
}catch(l){}var g=a.get_document().selection?a.get_document().selection:a.get_contentWindow().getSelection();
var d=g.type?g.type.toLowerCase()=="none":g.isCollapsed;
var s=a.get_document().body.innerHTML;
if(d||m==""||s==m){var i=Telerik.Web.UI.Editor.Utils.stripFormatting(s,n);
var o=new Telerik.Web.UI.Editor.GenericCommand(a.getLocalizedString(h)+" "+n,a.get_contentWindow());
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(a.get_document().body,i);
a.executeCommand(o);
}else{if(m!=null){var i=Telerik.Web.UI.Editor.Utils.stripFormatting(m,n);
var q=true;
if($telerik.isSafari&&n=="ALL"){var c=a.getSelection().getParentElement();
var j=function(p){var e=false;
switch(p){case"I":case"B":case"U":case"SPAN":case"FONT":case"EM":case"STRONG":e=true;
break;
}return e;
};
if(c.innerHTML.trim()==m.trim()&&j(c.tagName)){var r=true;
while(r){var t=c.parentNode;
if(t.childNodes.length==1&&j(t.tagName)){c=t;
}else{r=false;
}}var t=c.parentNode;
var f=a.get_document().createTextNode(i);
t.insertBefore(f,c);
t.removeChild(c);
a.selectElement(f);
q=false;
}}if(q){a.pasteHtml(i,h);
}}}};
this.InsertTable=function(b,f,c){var d=c.value;
if(d){var e=Telerik.Web.UI.Editor.Utils.createTable(d.rows,d.cols);
var a=Telerik.Web.UI.Editor.Utils.getOuterHtml(e);
f.pasteHtml(a,b);
}};
this.InsertTab=function(b,e,a){var c=e.getSelectedElement();
var d=c.tagName;
if(d=="UL"||d=="OL"||d=="LI"||(c.parentNode&&c.parentNode.tagName=="LI")){e.fire("Indent");
}else{e.pasteHtml(" &nbsp;&nbsp;&nbsp;&nbsp;",b);
}return false;
};
this.SetToolFocus=function(b,d,a){var c=d.get_toolAdapter();
if(c){c.setFocus();
}return false;
};
this.Undo=this.Redo=function(a,d,b){var c=b?b.value:1;
if(!c){c=1;
}if(a=="Redo"){d.redo(c);
}else{d.undo(c);
}};
this.PastePlainText=function(a,e,d){var c=function(g){if(g){var f=g.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
f=Telerik.Web.UI.Editor.Utils.replaceNewLineWithBr(f);
if(f){e.pasteHtml(f,a);
}}};
if(e.isIE){c(window.clipboardData.getData("Text"));
}else{var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){c(g.get_content());
});
e.showDialog("CleanPasteTextContent",{},b);
return false;
}};
this.PasteFromWord=this.PasteFromWordNoFontsNoSizes=this.PasteAsHtml=function(a,g,f){var e=function(i,h){var j="";
var k=g.get_stripFormattingOptions();
if(a=="PasteFromWord"){if(k==Telerik.Web.UI.StripFormattingOptions.None||(k&Telerik.Web.UI.StripFormattingOptions.ConvertWordLists)){i=Telerik.Web.UI.Editor.Utils._convertWordLists(i);
}j=Telerik.Web.UI.Editor.Utils.stripFormatting(i,"WORD");
}else{if(a=="PasteFromWordNoFontsNoSizes"){if(k==Telerik.Web.UI.StripFormattingOptions.None||(k&Telerik.Web.UI.StripFormattingOptions.ConvertWordLists)){i=Telerik.Web.UI.Editor.Utils._convertWordLists(i);
}j=Telerik.Web.UI.Editor.Utils.stripFormatting(i,"WORD_ALL");
}else{j=Telerik.Web.UI.Editor.Utils.convertText2Html(i);
}}if(h){h.select();
}if(j){g.pasteHtml(j,a);
}};
if(g.isIE){var b=g.createRestorePoint();
b.useOldRange=true;
var d=Telerik.Web.UI.Editor.Utils.getClipboardAsHtml();
e(d,b);
}else{var c=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(f,function(h,i){e(i.get_content());
});
g.showDialog("CleanPasteHtmlContent",{dialogTitle:g.getLocalizedString(a)},c);
}};
this.Copy=function(a,f,b){if(null!=b){var c=window.opera?false:true;
if(c){try{document.queryCommandEnabled(a);
}catch(d){c=false;
}}if(c){f.get_document().execCommand(a,false,null);
}else{alert(f.getLocalizedString("UseCtrlC"));
}}};
this.Cut=this.Paste=function(b,f,h){if(null!=h){var i=window.opera?false:true;
if(i){try{if(!f.isIE7){document.queryCommandEnabled(b);
}}catch(d){i=false;
}}if(b=="Paste"&&i&&f.isIE7){f.get_document().body.fireEvent("onbeforepaste");
}if(i){var c=new Telerik.Web.UI.Editor.GenericCommand(f.getLocalizedString(b),f.get_contentWindow());
var g=f.get_document().execCommand(b,false,null);
if(g!=false){f.executeCommand(c);
}else{i=false;
}}if(!i){var a=(b=="Cut"?"UseCtrlX":"UseCtrlV");
alert(f.getLocalizedString(a));
}}else{f._pendingCutPasteCommand=new Telerik.Web.UI.Editor.GenericCommand(f.getLocalizedString(b),f.get_contentWindow());
}};
this.InsertParagraph=function(b,c,a){c.executeBrowserCommand(b,true,"");
return true;
};
this.FormatBlock=function(a,c,b){c.executeCommand(new Telerik.Web.UI.Editor.FormatBlockCommand(c.getLocalizedString(a),c.get_contentWindow(),b.value));
};
this.InsertOrderedList=this.InsertUnorderedList=function(a,c,b){c.setFocus();
c.executeCommand(new Telerik.Web.UI.Editor.InsertListCommand(c.getLocalizedString(a),c.get_contentWindow(),c.get_newLineBr(),a,null));
};
this.Bold=this.Italic=this.Underline=this.JustifyLeft=this.JustifyRight=this.JustifyCenter=this.JustifyNone=this.Indent=this.Outdent=this.SelectAll=this.Unlink=this.JustifyFull=this.StrikeThrough=this.Subscript=this.Superscript=this.AbsolutePosition=function(b,e,a){e.setActive();
var d="SelectAll"!=b;
if(b=="Unlink"&&!e.isIE){var c=e.getSelectedElement();
if(c&&c.tagName=="A"){e.selectElement(c,false);
}}e.executeBrowserCommand(b,d,null,null);
return true;
};
this.ForeColor=this.BackColor=this.FontName=this.FontSize=function(a,d,b){var c=b.value;
d.executeBrowserCommand(a,true,c);
};
this.Zoom=function(a,e,b){var d=b.value;
var c=b.get_tool?b.get_tool():null;
if(d&&c&&c.updateValue){c.updateValue(d);
}e._contentArea.style.zoom=d;
return false;
};
this.Print=function(a,c,b){if(c.isIE){c.get_document().execCommand(a,false,null);
}else{if(c.get_contentWindow().print){c.get_contentWindow().print();
}}return false;
};
this.InsertSnippet=function(a,c,b){c.pasteHtml(b.value,a);
};
this.InsertFormElement=function(a,f,g){var e=g.value;
e=e.toLowerCase();
var c=null;
switch(e){case"form":c=f.createElement("form","150px","150px");
c.innerHTML="&nbsp;";
break;
case"textarea":c=f.createElement("textarea");
break;
case"select":c=f.createElement("select","100px","22px");
break;
case"checkbox":case"radio":c=f.createElement("input");
c.setAttribute("type",e);
break;
case"button":case"reset":case"submit":c=f.createElement("input","50px","22px");
c.setAttribute("type",e);
break;
case"hidden":case"password":case"text":c=f.createElement("input","100px","22px");
c.setAttribute("type",e);
break;
}if(c){var b=Telerik.Web.UI.Editor.Utils.getUniqueID();
c.setAttribute("id",b);
var d=Telerik.Web.UI.Editor.Utils.getOuterHtml(c);
f.pasteHtml(d,a);
var h=f.get_document().getElementById(b);
if(h){h.removeAttribute("id");
if(h.setActive){h.setActive();
}return false;
}}};
this.InsertGroupbox=this.InsertDate=this.InsertTime=this.InsertSymbol=this.InsertHorizontalRule=function(a,f,b){var d="";
switch(a){case"InsertSymbol":d=b.value;
break;
case"InsertHorizontalRule":d="<hr>";
break;
case"InsertDate":var c=new Date();
d="&nbsp;"+c.toLocaleDateString();
break;
case"InsertTime":var e=new Date();
d="&nbsp;"+e.toLocaleTimeString();
break;
default:d="<fieldset style='WIDTH: 200px; HEIGHT: 76px'> <legend>Title</legend>Content... </fieldset> ";
}f.pasteHtml(d,a);
};
this.ImageManager=function(c,e,a){var h=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(a,function(i,j){var k=j.get_value();
e.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(k),c);
});
var f=e.get_dialogOpener().get_additionalQueryString();
var b=e.getSelectedElement();
if(b&&b.tagName=="IMG"){var d=b.getAttribute("src",2);
e.get_dialogOpener().set_additionalQueryString(f+"&rndnum="+(new Date()-100)+"&PreselectedItemUrl="+encodeURIComponent(d));
}else{b=null;
}var g=new Telerik.Web.UI.EditorCommandEventArgs(c,null,b);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(g,"IMG",e,c);
e.showDialog("ImageManager",g,h);
e.get_dialogOpener().set_additionalQueryString(f);
return false;
};
this.SilverlightManager=this.FlashManager=this.MediaManager=function(c,e,a){var h=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(a,function(i,k){var m=k.get_value();
if(!m){m=k.Result;
}var l=e.get_filtersManager().getFilterByName("IEKeepObjectParamsFilter");
var j=e.get_filtersManager().getFilterByName("MozillaKeepFlash");
if(l){m=l.getDesignContent(m);
}if(j){var n=e.get_document().createElement("div");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(n,m);
n=j.getDesignContent(n);
m=n.innerHTML;
}e.pasteHtml(m,c);
});
var g={};
var f=e.get_dialogOpener().get_additionalQueryString();
var b=e.getSelectedElement();
if(b){if($telerik.isIE&&b.object){var d="MediaManager"==c?b.object.FileName:b.object.Movie;
if(d){e.get_dialogOpener().set_additionalQueryString(f+"&rndnum="+(new Date()-100)+"&PreselectedItemUrl="+encodeURIComponent(d));
g.selectedItemUrl=d;
g.selectedObject=b;
}}}e.showDialog(c,g,h);
e.get_dialogOpener().set_additionalQueryString(f);
return false;
};
this.TemplateManager=function(a,d,c){var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(c,function(e,f){var g=f.get_value();
if(!g){g=f.Result;
}d.pasteHtml(g,a);
});
d.showDialog("TemplateManager",{},b);
return false;
};
this.AboutDialog=function(b,c,a){c.showDialog("AboutDialog");
return false;
};
this.Help=function(b,c,a){c.showDialog("Help");
return false;
};
this.PageProperties=function(a,e,d){var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){});
var c={};
Telerik.Web.UI.Editor.CommandList._getDialogArguments(c,"BODY",e,a);
e.showDialog("PageProperties",c,b);
return false;
};
this.ImageMapDialog=function(a,e,d){var c=Telerik.Web.UI.Editor.CommandList._getImageMapDialogArgument(e);
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){Telerik.Web.UI.Editor.CommandList._setImageMapProperties(e,g);
return false;
});
e.showDialog("ImageMapDialog",c,b);
return false;
};
this._setImageMapProperties=function(g,j){if(!j){return;
}var a=g.getSelectedElement();
var i;
if(a&&a.tagName=="IMG"){i=a;
if(j.ImageSrc!=i.src){i.src=j.ImageSrc;
}}else{if(!j.ImageSrc){return;
}g.pasteHtml('<img src="'+j.ImageSrc+'" id = "__tmp__">');
i=g.get_document().getElementById("__tmp__");
i.removeAttribute("id");
if(document.all){var n=g.get_document().body.createTextRange();
n.collapse();
n.moveToElementText(i);
n.select();
}}var m=document.createElement("SPAN");
m.innerHTML=j.MapHtml;
var c=m.getElementsByTagName("map");
if(c.length==0){return;
}var b=c[0].innerHTML;
m=null;
if(!b){var f=i.getAttribute("useMap",2);
if(f){var l=Telerik.Web.UI.Editor.CommandList._getImageMapByName(g,f);
if(l){l.parentNode.removeChild(l);
}}i.removeAttribute("useMap");
return;
}var d=null;
var e=i.getAttribute("useMap",2);
if(e){d=Telerik.Web.UI.Editor.CommandList._getImageMapByName(g,e);
}if(d==null){var h=new Date()-100;
var k="rade_img_map_"+h;
d=g.get_document().createElement("map");
d.id=k;
this._setNameAttribute(d,k);
d=g.get_document().body.appendChild(d);
i.setAttribute("useMap","#"+k);
i.setAttribute("border","0");
}d.innerHTML=b;
};
this._setNameAttribute=function(b,a){b.removeAttribute("name");
b.removeAttribute("NAME");
b.name=null;
b.name=a;
b.NAME=a;
};
this._getImageMapDialogArgument=function(f){var c={};
c.editor=f;
var e=f.getSelectedElement();
if(e&&e.tagName=="IMG"){c.ImageSrc=e.getAttribute("src",2);
c.ImageWidth=(e.style.width)?e.style.width:e.width;
c.ImageHeight=(e.style.height)?e.style.height:e.height;
if($telerik.isIE){var a=f.get_document().body.createTextRange();
a.collapse();
a.moveToElementText(e);
a.select();
}if(e.useMap){var b=e.getAttribute("useMap",2);
var d=Telerik.Web.UI.Editor.CommandList._getImageMapByName(f,b);
if(d!=null){c.ImageMapHTML='<map name = "'+b.substr(1)+'">'+d.innerHTML+"</map>";
}else{c.ImageMapHTML="";
}e.style.width=c.ImageWidth;
e.style.height=c.ImageHeight;
}}return c;
};
this._getImageMapByName=function(f,b){b=b.substr(1);
var a=f.get_document();
var d=a.getElementById(b);
if(d!=null){return d;
}var e=a.getElementsByTagName("map");
for(var c=0;
c<e.length;
c++){if(e[c].getAttribute("name")==b){return e[c];
}}return null;
};
this.get_ImportStyleSheetHTML=function(a,f,c){var d="";
var b=f.get_document();
if(c){var e=b.getElementById(c.id);
if(!e){d=Telerik.Web.UI.Editor.Utils.getOuterHtml(c);
}}return d;
};
this._removeStyleSheet=function(e,b){if(b){var d=e.get_document();
var j=true;
var c=d.getElementsByTagName("Table");
var f=c.length;
var g=b.id;
if(g){for(var a=0;
a<f;
a++){var k=c[a];
if(k.className==g){j=false;
break;
}}if(j){var h=d.getElementById(g);
if(h){h.parentNode.removeChild(h);
}}}}};
this.TableWizard=function(a,e,d){var c=Telerik.Web.UI.Editor.CommandList._getTableArgument(e,null,true,false);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(c,"TABLE",e,a);
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){var h="";
if(g.styleSheetToImport){h=Telerik.Web.UI.Editor.CommandList.get_ImportStyleSheetHTML(a,e,g.styleSheetToImport);
}e.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(g.tableToModify)+h,a);
if(g.styleSheetToRemove){Telerik.Web.UI.Editor.CommandList._removeStyleSheet(e,g.styleSheetToRemove);
}});
e.showDialog("TableWizard",c,b);
return false;
};
this.SetTableProperties=function(a,f,e){var d=Telerik.Web.UI.Editor.CommandList._getTableArgument(f,1,false,true);
if(!d){alert(f.getLocalizedString("tablewarning"));
return false;
}Telerik.Web.UI.Editor.CommandList._getDialogArguments(d,"TABLE",f,a);
var c=Telerik.Web.UI.Editor.CommandList._getParentTable(f);
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(e,function(g,h){f.selectElement(c);
var i="";
if(h.styleSheetToImport){i=Telerik.Web.UI.Editor.CommandList.get_ImportStyleSheetHTML(a,f,h.styleSheetToImport);
}f.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(h.tableToModify)+i,a);
if(h.styleSheetToRemove){Telerik.Web.UI.Editor.CommandList._removeStyleSheet(f,h.styleSheetToRemove);
}});
if(f.get_document().selection&&f.get_document().selection.empty){f.get_document().selection.empty();
}f.showDialog("TableWizard",d,b);
return false;
};
this.SetCellProperties=function(b,g,f){var e=Telerik.Web.UI.Editor.CommandList._getTableArgument(g,2,false,true);
var a=$telerik.isFirefox&&g.get_contentWindow().getSelection().rangeCount>1;
if(!e||a){alert(g.getLocalizedString("cellwarning"));
return false;
}Telerik.Web.UI.Editor.CommandList._getDialogArguments(e,"TABLE",g,b);
var d=Telerik.Web.UI.Editor.CommandList._getParentTable(g);
var c=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(f,function(h,i){g.selectElement(d);
var j="";
if(i.styleSheetToImport){j=Telerik.Web.UI.Editor.CommandList.get_ImportStyleSheetHTML(b,g,i.styleSheetToImport);
}g.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(i.tableToModify)+j,b);
if(i.styleSheetToRemove){Telerik.Web.UI.Editor.CommandList._removeStyleSheet(g,i.styleSheetToRemove);
}});
g.showDialog("TableWizard",e,c);
return false;
};
this.FindAndReplace=function(a,e,d){var c={};
c.editor=e;
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){});
e.showDialog("FindAndReplace",c,b);
return false;
};
this.StyleBuilder=function(c,e,f){var i=null;
var j=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(f,function(k,m){var p=Telerik.Web.UI.Editor.Utils.getOuterHtml(m.get_value());
if(i){var n="";
var o=new RegExp("style=(\"|')(.+?)\\1","gi");
p.replace(o,function(s,q,r){n=r;
});
if(n){var l=new Telerik.Web.UI.Editor.AttributeCommand(c+"set Style Attribute",e.get_contentWindow(),i,"style",n);
e.executeCommand(l);
}}else{e.pasteHtml(p,c);
}});
var a=e.getSelection();
var d=a.getParentElement();
if(!$telerik.isIE||!a.isControl()){var b=a.getText();
if(b||d.tagName=="BODY"){var g=e.createElement("span");
Telerik.Web.UI.Editor.Utils.setElementInnerHtml(g,b);
d=g;
}else{i=d;
e.selectElement(d,false);
}}var h=new Telerik.Web.UI.EditorCommandEventArgs("StyleBuilder",null,d.cloneNode(true));
Telerik.Web.UI.Editor.CommandList._getDialogArguments(h,"*",e,c);
h.fontNames=e.get_fontNames();
e.showDialog("StyleBuilder",h,j);
return false;
};
this.XhtmlValidator=function(a,e,d){var c=e;
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){});
e.showDialog("XhtmlValidator",c,b);
return false;
};
this.TrackChangesDialog=function(a,e,d){var c=e;
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(f,g){});
e.showDialog("TrackChangesDialog",c,b);
};
this.InsertCustomLink=function(b,g,c){var e=c.value;
var d=String.format("<a href='{1}' title='{3}' target='{2}'>{0}</a>",e.innerHTML,e.href,e.target,e.title);
var f=Telerik.Web.UI.Editor.CommandList._getParentLink(g);
if(f){var a=f.cloneNode(true);
if(e.href){a.setAttribute("href",e.href);
}if(e.target){a.setAttribute("target",e.target);
}if(e.title){a.setAttribute("title",e.title);
}if(!a.innerHTML){a.innerHTML=e.innerHTML;
}d=Telerik.Web.UI.Editor.Utils.getOuterHtml(a);
}g.pasteHtml(d,b);
};
this._getDialogArguments=function(b,c,d,a){if(!d){b.Colors=[];
b.CssClasses=[];
b.CellCssClasses=[];
b.tableLayoutCssFile="";
b.editor=null;
return;
}b.Colors=d.get_colors();
if("TD"==c||"TH"==c||"TABLE"==c){b.CssClasses=d.getCssArray("TABLE");
b.CellCssClasses=d.getCssArray("TD");
b.tableLayoutCssFile=d.get_tableLayoutCssFile();
}else{if("A"==c||"BODY"==c||"IMG"==c){b.CssClasses=d.getCssArray(c);
}}b.editor=d;
};
this.DocumentManager=this.SetLinkProperties=this.LinkManager=function(a,f,d){var e=a=="DocumentManager"?"DocumentManager":"LinkManager";
var c=Telerik.Web.UI.Editor.CommandList._getLinkArgument(f);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(c,"A",f,a);
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(d,function(g,h){var i=h.get_value();
if(!i){i=h.Result;
}if(!i){i=h.realLink;
}f.pasteHyperLink(i,a);
});
f.showDialog(e,c,b);
return false;
};
this.SetImageProperties=function(a,f,e){var c=f.getSelectedElement();
if(c.nodeName.toLowerCase()!="img"){c=null;
}var d=new Telerik.Web.UI.EditorCommandEventArgs("SetImageProperties",null,c);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(d,"IMG",f,a);
d.Element=c;
var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(e,function(g,h){var i=h.get_value?h.get_value():h.Result;
if(!i){return;
}if(c&&c.parentNode){c.parentNode.replaceChild(i,c);
}else{f.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(i),a);
}});
f.showDialog("ImageProperties",d,b);
return false;
};
this.FormatCodeBlock=function(a,f,e){var d=new Telerik.Web.UI.EditorCommandEventArgs("FormatCodeBlock",null,f.getSelectionHtml());
d.dirtyCode=f.getSelectionHtml();
if(f.get_document().selection&&f.get_document().selection){var c=f.get_document().selection.type.toLowerCase();
if(c=="control"||c=="none"){d.set_value("");
}}var b=Telerik.Web.UI.Editor.CommandList.getCallbackFunction(e,function(g,h){f.pasteHtml(h.get_value?h.get_value():h.get_code(),a);
});
f.showDialog("FormatCodeBlock",d,b);
return false;
};
this._getDocumentAnchors=function(b){var a=b.getElementsByTagName("A");
var d=new Array();
for(var c=0;
c<a.length;
c++){if(a[c].name){d[d.length]=a[c];
}}return d;
};
this._getParentLink=function(f){var a=f.getSelectedElement();
var h=Telerik.Web.UI.Editor.Utils.getElementParentByTag(a,"A");
if(h){f.selectElement(h);
}else{var g="";
var b=(a&&a.tagName)?a.tagName:"";
if(b=="IMG"){g=Telerik.Web.UI.Editor.Utils.getOuterHtml(a);
}else{if($telerik.isIE&&f.getSelectionHtml()){if(b=="BODY"||b=="TD"||b=="TABLE"||b=="P"||b=="LI"||b=="UL"||b=="OL"){var c=f.getSelection().getRange();
if(c.collapse){c.collapse(false);
var i=c.parentElement();
if($telerik.isDescendant(a,i)){g=i.innerHTML;
c.moveToElementText(i);
c.select();
}}}}}if(!g){g=f.getSelectionHtml();
}h=f.get_document().createElement("A");
try{Telerik.Web.UI.Editor.Utils.setElementInnerHtml(h,g);
}catch(d){h.innerHTML=Telerik.Web.UI.Editor.Utils.stripFormatting(g,"ALL");
}}return h;
};
this._getLinkArgument=function(f,d){var e=Telerik.Web.UI.Editor.CommandList._getParentLink(f);
var b=e.innerHTML;
var c=!b?false:b.match(/</);
if($telerik.isIE&&c){if(b.trim().toLowerCase()=="<p>&nbsp;</p>"){e.innerHTML=" ";
c=false;
}}var a=new Telerik.Web.UI.EditorCommandEventArgs("LinkManager",null,e.cloneNode(true));
a.selectedTabIndex=d?d:0;
a.showText=!c;
a.documentAnchors=Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(f.get_document());
a.realLink=a.get_value();
return a;
};
this._getParentTable=function(c){c.setFocus();
var b=c.getSelectedElement();
var a=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"TABLE");
return a;
};
this._getParentCell=function(c){c.setFocus();
var b=c.getSelectedElement();
var a=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"TD");
if(!a){a=Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"TH");
}return a;
};
this._getTableArgument=function(f,e,d,a){var h;
var g=null;
if(d){h=Telerik.Web.UI.Editor.Utils.createTable(2,2,f._document);
}else{h=Telerik.Web.UI.Editor.CommandList._getParentTable(f);
}if(!d&&!h){return null;
}if(a){g=Telerik.Web.UI.Editor.CommandList._getParentCell(f);
}var c=h.cloneNode(true);
var b=h;
return{selectedTabIndex:e?e:0,cellToModify:g,tableToModify:c,originalTable:b,tableDocument:(c.document)?c.document:f.get_document()};
};
this.EnterParagraphMozilla=function(e,i,k){var b=i.getSelectedElement();
if(b.tagName=="A"||"LI"==b.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(b,"LI")!=null){i.bubbleKeyEventToBrowser();
return false;
}function d(o){if(!o){return null;
}var n=o;
var p=n.tagName;
while(p!="TD"&&p!="BODY"){p=n.tagName;
if(!p){p="";
}if(p=="P"||(p.charAt(0)=="H"&&!isNaN(parseInt(p.charAt(1))))||p=="ADDRESS"||p=="PRE"){return n;
}n=n.parentNode;
if(!n){return null;
}}}var l=d(b);
if(l&&l.tagName!="P"){i.bubbleKeyEventToBrowser();
return false;
}if(!l){i.get_document().execCommand("InsertParagraph",null,false);
l=d(i.getSelectedElement());
}var g=new Telerik.Web.UI.Editor.GenericCommand("Enter",i.get_contentWindow());
var h=i.getSelection().getRange();
h.deleteContents();
var m=h.startOffset;
var f=h.startContainer;
var c=h.cloneRange();
c.setStart(l,0);
c.setEnd(f,m);
var j=c.extractContents();
var a=l.cloneNode(false);
a.appendChild(j);
l.parentNode.insertBefore(a,l);
if(!Telerik.Web.UI.Editor.Utils.getTextContent(a)){a.innerHTML="&nbsp;";
}i.executeCommand(g);
return false;
};
this.Enter=function(b,e,g){var h=e.getSelectedElement();
if("LI"==h.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(h,"LI")!=null){e.bubbleKeyEventToBrowser();
return false;
}try{var f=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",e.get_contentWindow());
var a=e.get_document().selection.createRange();
if(a.pasteHTML){var d=h.tagName;
if(d.charAt(0)=="H"&&parseInt(d.charAt(1))>0){var c=a.duplicate();
c.moveToElementText(h);
e.bubbleKeyEventToBrowser();
return false;
}else{if(d.toLowerCase()=="textarea"){e.bubbleKeyEventToBrowser();
return false;
}}a.pasteHTML("<br>");
a.select();
a.moveEnd("character",1);
a.moveStart("character",1);
a.collapse(false);
}else{if(a(0)){a.execCommand("Delete");
}}e.executeCommand(f);
}catch(i){alert(i.message);
}return false;
};
this.ShiftEnter=function(b,f,c){var e=f.getSelectedElement();
if("LI"==e.tagName||Telerik.Web.UI.Editor.Utils.getElementParentByTag(e,"LI")!=null){var d=new Telerik.Web.UI.Editor.GenericCommand("Enter Pressed",f.get_contentWindow());
var a=f.get_document().selection.createRange();
a.pasteHTML("<br>");
a.select();
a.moveEnd("character",1);
a.moveStart("character",1);
a.collapse(false);
f.executeCommand(d);
return false;
}f.bubbleKeyEventToBrowser();
return false;
};
this.ToggleTableBorder=function(a,c,b){c.toggleEnhancedEdit();
return false;
};
this.ConvertToUpper=this.ConvertToLower=function(d,j,l){var f;
var b;
if($telerik.isIE){if(j._document.selection.type.toLowerCase()=="control"){return;
}var p=j._document.selection.createRange();
f=p.duplicate();
b=p.duplicate();
f.collapse();
b.collapse(false);
}var o=Telerik.Web.UI.Editor.CommandList._markEditorSelection(j);
var e=o.markedElements;
var q=o.newElements;
var m=new Telerik.Web.UI.Editor.GenericCommand(j.getLocalizedString(d),j.get_contentWindow());
for(var a=0;
a<e.length;
a++){g(e[a]);
}for(var a=0;
a<q.length;
a++){if($telerik.isIE){q[a].removeNode(false);
}else{var h=document.createRange();
h.selectNodeContents(q[a]);
q[a].parentNode.replaceChild(h.extractContents(),q[a]);
}}if($telerik.isIE){var n=j._document.selection.createRange();
n.setEndPoint("StartToStart",f);
n.setEndPoint("EndToEnd",b);
n.select();
}else{var k=j.get_contentWindow().getSelection();
var c=k.getRangeAt(0);
c.collapse(true);
}j.executeCommand(m);
function g(r){var s=r.childNodes;
for(var t=0;
t<s.length;
t++){if(s[t].nodeType==3){s[t].nodeValue=("ConvertToLower"==d)?s[t].nodeValue.toLowerCase():s[t].nodeValue.toUpperCase();
}else{if(s[t].nodeType==1&&s[t].tagName.toUpperCase()!="FONT"){g(s[t]);
}}}}};
this.ApplyClass=function(d,j,k){var n=true;
var a=k.get_value();
var c=j.get_contentWindow();
var f=j.get_document();
var o=j.createRestorePoint();
var l=new Telerik.Web.UI.Editor.GenericCommand(j.getLocalizedString(d)+' ["'+a+'"]',j.get_contentWindow());
var h=Telerik.Web.UI.Editor.Utils.getFullySelectedElement(c);
if(h){Telerik.Web.UI.Editor.Utils.setElementClassName(h,a);
n=false;
}else{if(!a){f.execCommand("RemoveFormat",false,null);
n=false;
}}if(n){var m=Telerik.Web.UI.Editor.CommandList._markEditorSelection(j);
var e=m.markedElements;
if(e.length>0){for(var g=0;
g<e.length;
g++){var b=e[g];
if(b.className&&b.className!="Apple-style-span"){continue;
}else{b.className=a;
}}if(!$telerik.isIE){Telerik.Web.UI.Editor.Utils.addElementsToSelection(j.get_contentWindow(),e);
}}else{Telerik.Web.UI.Editor.CommandList._completeEditorSelection(j,"class='"+a+"'");
}}j.executeCommand(l);
},this.RealFontSize=function(a,d,f){var b=f.get_value();
var e=new Telerik.Web.UI.Editor.GenericCommand(d.getLocalizedString(a)+' ["'+b+'"]',d.get_contentWindow());
var h=Telerik.Web.UI.Editor.CommandList._markEditorSelection(d);
var c=h.markedElements;
if(c.length>0){for(var g=0;
g<c.length;
g++){c[g].style.fontSize=b;
c[g].removeAttribute("size");
}if(!$telerik.isIE){Telerik.Web.UI.Editor.Utils.addElementsToSelection(d.get_contentWindow(),c);
}}else{Telerik.Web.UI.Editor.CommandList._completeEditorSelection(d,"style='font-size:"+b+"'");
}d.executeCommand(e);
},this._completeEditorSelection=function(f,i){if(!i){i="";
}var c=f.get_contentWindow();
var d=f.get_document();
var g=f.getSelection().getParentElement().tagName;
if($telerik.isIE&&!f.getSelectionHtml()&&(g=="FONT"||g=="SPAN")){d.execCommand("RemoveFormat",null,false);
}var a=f.getSelection();
a.pasteHtml("<font "+i+" id='radERealFont'>&nbsp;</font>");
var b=f.get_document().getElementById("radERealFont");
b.removeAttribute("id");
if($telerik.isIE){f.selectElement(b);
f.getSelection().collapse();
b.innerHTML="";
}else{if(c.getSelection){var h=c.getSelection();
var e=f.getSelection().getRange();
h.removeAllRanges();
b.innerHTML="";
if(e&&e.selectNodeContents){e.selectNodeContents(b);
}h.addRange(e);
}}},this._markEditorSelection=function(a){if(a.get_html()==""){return{markedElements:[],newElements:[]};
}var o="AZBY";
var e="_cm";
var d=[];
var k=[];
var u=[];
var l=$telerik.isSafari2||$telerik.isSafari3;
var m=l?"span":"font";
var b=a._contentArea;
if(l){var t=new Telerik.Web.UI.Editor.OptimizeSpans();
t.getHtmlContent(b);
}var f=a.getSelection();
if(f.isControl()){var n=f.getParentElement();
var g=a._document.createElement(m);
g.appendChild(n.cloneNode(true));
n.parentNode.replaceChild(g,n);
return{markedElements:[g],newElements:[g]};
}c();
if(!$telerik.isIE){b.ownerDocument.execCommand("UseCSS",false,true);
b.ownerDocument.execCommand("styleWithCSS",false,false);
}b.ownerDocument.execCommand("FontName",false,o);
var s=b.getElementsByTagName(m);
for(var p=0;
p<s.length;
p++){var g=s[p];
if(g.getAttribute("face")==o||g.style.fontFamily==o){g.removeAttribute("face");
if(g.style.fontFamily==o){g.style.fontFamily="";
if(g.className=="Apple-style-span"){g.className="";
}}k.push(g);
var r=g.getElementsByTagName(m);
for(var q=0;
q<r.length;
q++){var v=r[q];
if(v.getAttribute("face")!=o){k.push(v);
}}if(!g.getAttribute(e)){u.push(g);
}}g.removeAttribute(e);
}h();
if(!$telerik.isIE){b.ownerDocument.execCommand("UseCSS",false,false);
b.ownerDocument.execCommand("styleWithCSS",false,true);
}function c(){var w=a._contentArea.getElementsByTagName(m);
for(var x=0;
x<w.length;
x++){var j=w[x];
if(w[x].face){j.setAttribute("_face",j.face);
d.push(j);
}else{if(l){j.setAttribute("_face",j.style.fontFamily);
d.push(j);
}}j.setAttribute(e,1);
}}function h(){for(var j=0;
j<d.length;
j++){if(l){d[j].style.fontFamily=d[j].getAttribute("_face");
}else{d[j].face=d[j].getAttribute("_face");
}d[j].removeAttribute("_face");
}d=[];
}return{markedElements:k,newElements:u};
};
})();
if(typeof(RadEditorCommandList)=="undefined"){var RadEditorCommandList=Telerik.Web.UI.Editor.CommandList;
}Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.CommandsManager=function(a){this._commands=[];
this._currentCommandIndex=-1;
};
Telerik.Web.UI.Editor.CommandsManager.prototype={get_commands:function(){return this._commands;
},execute:function(a,b){if(a&&a.execute){var c=a.execute();
if(false==b){return false;
}if(c&&a._canUnexecute){this._clearCommandsToRedo();
Array.add(this._commands,a);
this._currentCommandIndex=this._commands.length-1;
return true;
}}return false;
},undo:function(b){if(b>this._commands.length){b=this._commands.length;
}var c=0;
var a=null;
while(0<b--&&0<=this._currentCommandIndex&&this._currentCommandIndex<this._commands.length){a=this._commands[this._currentCommandIndex--];
if(a){a.unexecute();
c++;
}}},redo:function(b){if(b>this._commands.length){b=this._commands.length;
}var d=0;
var a=null;
var c=this._currentCommandIndex+1;
while(0<b--&&0<=c&&c<this._commands.length){a=this._commands[c];
if(a){a.execute();
this._currentCommandIndex=c;
d++;
}c++;
}},removeCommandAt:function(a){this._commands.splice(a,1);
if(this._currentCommandIndex>=a){this._currentCommandIndex--;
}},isUndoAvailable:function(){return(-1<this._currentCommandIndex);
},isRedoAvailable:function(){return(this._currentCommandIndex<this._commands.length-1);
},getCommandsToUndo:function(){if(this.isUndoAvailable()){return(this._commands.slice(0,this._currentCommandIndex+1)).reverse();
}else{return[];
}},getCommandsToRedo:function(){if(this.isRedoAvailable()){return this._commands.slice(this._currentCommandIndex+1);
}else{return[];
}},canRepeatLastCommand:function(){return((this._currentCommandIndex==this._commands.length-1)&&null!=this._commands[this._currentCommandIndex]&&("function"==typeof(this._commands[this._currentCommandIndex].clone)));
},repeatLastCommand:function(){if(this.canRepeatLastCommand()){var a=this._commands[this._currentCommandIndex].clone();
this.execute(a);
}},_clearCommandsToRedo:function(){if(this.isRedoAvailable()){this._commands.splice(this._currentCommandIndex+1,this._commands.length-this._currentCommandIndex);
}}};
Telerik.Web.UI.Editor.CommandsManager.registerClass("Telerik.Web.UI.Editor.CommandsManager",null);
Type.registerNamespace("Telerik.Web.UI");
(function(){var b=$telerik.$;
var a=Telerik.Web.UI;
b.registerEnum(a,"EditingOptions",{Typing:1,Tools:2,ContextMenus:4,Tab:8,Modules:16,EditModes:32,All:63});
b.registerEnum(a,"StripFormattingOptions",{None:0,NoneSupressCleanMessage:1,MSWord:2,MSWordNoFonts:4,MSWordRemoveAll:8,Css:16,Font:32,Span:64,AllExceptNewLines:128,ConvertWordLists:256,All:512});
b.registerEnum(a,"EditorToolbarMode",{Default:1,Floating:2,PageTop:4,ShowOnFocus:8});
b.registerEnum(a,"EditorFilters",{None:0,RemoveScripts:1,MakeUrlsAbsolute:2,FixUlBoldItalic:4,FixEnclosingP:8,IECleanAnchors:16,MozEmStrong:32,ConvertFontToSpan:64,ConvertToXhtml:128,IndentHTMLContent:256,EncodeScripts:512,OptimizeSpans:1024,DefaultFilters:65533});
b.registerEnum(a,"EditorToolType",{Button:1,DropDown:2,SplitButton:4,Separator:8,ToolStrip:16,Custom:32});
b.registerEnum(a,"EditModes",{Design:1,Html:2,Preview:4,All:7});
})();
Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Filter=function(){Telerik.Web.UI.Editor.Filter.initializeBase(this);
this.IsDom=false;
this.Enabled=false;
this.Name="RadEditor filter";
this.Description="RadEditor filter description";
};
Telerik.Web.UI.Editor.Filter.prototype={getHtmlContent:function(a){return a;
},getDesignContent:function(a){return a;
},get_isDom:function(){return this.IsDom;
},set_isDom:function(a){this.IsDom=a;
},get_enabled:function(){return this.Enabled;
},set_enabled:function(a){this.Enabled=a;
},get_name:function(){return this.Name;
},set_name:function(a){this.Name=a;
},get_description:function(){return this.Description;
},set_description:function(a){this.Description=a;
}};
Telerik.Web.UI.Editor.Filter.registerClass("Telerik.Web.UI.Editor.Filter",Sys.Component);
Telerik.Web.UI.Editor.StripScriptsFilter=function(){Telerik.Web.UI.Editor.StripScriptsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="StripScriptsFilter";
this.Description="This filter strips all script tags from the content.";
};
Telerik.Web.UI.Editor.StripScriptsFilter.prototype={getHtmlContent:function(a){return this._performStripping(a);
},getDesignContent:function(a){return this._performStripping(a);
},_performStripping:function(b){var a=b.replace(new RegExp("<(SCRIPT)([^>]*)/>","ig"),"");
a=a.replace(RegExp("<(SCRIPT)([^>]*)>[\\s\\S]*?</(SCRIPT)([^>]*)>","ig"),"");
return a;
}};
Telerik.Web.UI.Editor.StripScriptsFilter.registerClass("Telerik.Web.UI.Editor.StripScriptsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.EncodeScriptsFilter=function(){Telerik.Web.UI.Editor.EncodeScriptsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="EncodeScriptsFilter";
this.Description="This filter encodes all script tags from the content.";
};
Telerik.Web.UI.Editor.EncodeScriptsFilter.prototype={getHtmlContent:function(a){var e=new RegExp("<!--RADEDITORSAVEDTAG_([\\s\\S]*?)-->","ig");
var d=new RegExp("RADEDITORSAVEDTAGENDING","ig");
var c=new RegExp("RADEDITORSAVEDTAGBEGINNING","ig");
var b=a.replace(e,"<$1>");
b=b.replace(d,"-->");
b=b.replace(c,"<!--");
return b;
},getDesignContent:function(a){var b=function(m,i,f,q,e){var n=e.substring(0,q).lastIndexOf("<!--");
var o=e.substring(0,q).lastIndexOf("-->");
if(n>o){n=e.substring(q,e.length).indexOf("<!--");
o=e.substring(q,e.length).indexOf("-->");
if((n==-1&&o>-1)||(o<n)){return m;
}}var k=new RegExp("-->","ig");
var g=new RegExp("<!--","ig");
var h=f.replace(k,"RADEDITORSAVEDTAGENDING");
var h=h.replace(g,"RADEDITORSAVEDTAGBEGINNING");
var p="<!--RADEDITORSAVEDTAG_"+i+h+"-->";
return p;
};
var c=new RegExp("<(script|noscript)([\\s\\S]*?<\\/\\1)>","ig");
var d=a.replace(c,b);
return d;
}};
Telerik.Web.UI.Editor.EncodeScriptsFilter.registerClass("Telerik.Web.UI.Editor.EncodeScriptsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.RemoveExtraBrakes=function(){Telerik.Web.UI.Editor.RemoveExtraBrakes.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="RemoveExtraBrakes";
this.Description="This filter strips all extra brakse inside some tags like p, h1, etc.";
};
Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype={getHtmlContent:function(a){return this._performStripping(a);
},_performStripping:function(b){var a=b;
var a=a.replace(/<BR\s?\/?>\s*<\/(H1|H2|H3|H4|H5|H6|LI|P)/ig,function(d,c,e,f){if(!f.substr(0,e).match(/<BR\s?\/?>\s*$/gi)){d="</"+c;
}return d;
});
a=a.replace(/<(H1|H2|H3|H4|H5|H6|LI|P)([^>]*)?><BR\s?\/?>/ig,"<$1 $2>");
return a;
}};
Telerik.Web.UI.Editor.RemoveExtraBrakes.registerClass("Telerik.Web.UI.Editor.RemoveExtraBrakes",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixNestedLists=function(){Telerik.Web.UI.Editor.FixNestedLists.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixNestedLists";
this.Description="This filter produces valid XHTML from nested lists";
};
Telerik.Web.UI.Editor.FixNestedLists.prototype={_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},fixLists:function(c,g){var b=this._getElements(c,g);
for(var f=b.length-1;
f>=0;
f--){var d=b[f];
var e=d.previousSibling;
if(e&&e.nodeType==3){e=e.previousSibling;
}if(e&&"li"==d.previousSibling.nodeName.toLowerCase()){e.appendChild(d.cloneNode(true));
var a=d.parentNode;
a.removeChild(d);
a=null;
}}},getHtmlContent:function(a){this.fixLists(a,"OL");
this.fixLists(a,"UL");
return a;
}};
Telerik.Web.UI.Editor.FixNestedLists.registerClass("Telerik.Web.UI.Editor.FixNestedLists",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixUlBoldItalic=function(){Telerik.Web.UI.Editor.FixUlBoldItalic.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixUlBoldItalic";
this.Description="This filter changes u, b, i tags to spans with CSS";
};
Telerik.Web.UI.Editor.FixUlBoldItalic.prototype={_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},_replaceElementWithSpan:function(m,h,k){var n=this._getElements(m,h);
var d=[];
for(var b=n.length-1;
b>=0;
b--){Array.add(d,n[b]);
}for(var a=0,c=d.length;
a<c;
a++){var e=m.ownerDocument.createElement("span");
e.style.cssText=k;
var f=d[a];
var g=f.innerHTML;
if($telerik.isIE&&g==" "){e.innerText=g;
}else{Telerik.Web.UI.Editor.Utils.setElementInnerHtml(e,g);
}f.parentNode.replaceChild(e,f);
}},_replaceSpanWithElement:function(o,n,f){var q=this._getElements(o,"span");
var e=[];
for(var b=q.length-1;
b>=0;
b--){Array.add(e,q[b]);
}for(var a=0,c=e.length;
a<c;
a++){var m=[];
var g=e[a];
for(var p=0;
p<g.childNodes.length;
p++){Array.add(m,g.childNodes[p].cloneNode(true));
}if(g.style.cssText.toLowerCase()==f||g.style.cssText.toLowerCase()==(f+";")){var h=o.ownerDocument.createElement(n);
for(var d=0;
d<m.length;
d++){h.appendChild(m[d]);
}g.parentNode.replaceChild(h,g);
}}},getHtmlContent:function(a){this._replaceElementWithSpan(a,"u","text-decoration:underline;");
return a;
},getDesignContent:function(a){this._replaceSpanWithElement(a,"u","text-decoration: underline");
return a;
}};
Telerik.Web.UI.Editor.FixUlBoldItalic.registerClass("Telerik.Web.UI.Editor.FixUlBoldItalic",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.OptimizeSpans=function(){Telerik.Web.UI.Editor.OptimizeSpans.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="OptimizeSpans";
this.Description="This filter changes removes unneeded span elements";
};
Telerik.Web.UI.Editor.OptimizeSpans.prototype={_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},_singleChild:function(f){if(f==null||f.parentNode==null){return false;
}var c=f.parentNode;
var a=0;
for(var d=0,b=c.childNodes.length;
d<b&&a<2;
d++){var e=c.childNodes[d];
if(e.nodeType==3&&String(e.nodeValue).trim()==""){continue;
}a++;
}return(a==1);
},_optimizeElement:function(b){var k=b.parentNode;
var n=b.innerHTML;
var d=["align","dir","lang","title","class","id"];
var m=true;
for(var a=0,c=d.length;
a<c;
a++){m|=this._checkAttribute(b,k,d[a]);
}if(!m){return;
}for(var a=0,c=d.length;
a<c;
a++){var f=d[a];
var g=b.getAttribute(f,2);
if(g){k.setAttribute(f,g);
}}var e=$telerik.isIE?b.style.cssText:b.getAttribute("style",2);
if(e){var h=$telerik.isIE?k.style.cssText:k.getAttribute("style",2);
h=h?h+";":"";
if($telerik.isIE){k.style.cssText=h+e;
}else{k.setAttribute("style",h+e);
}}Telerik.Web.UI.Editor.Utils.removeNode(b);
},_checkAttribute:function(e,d,a){var c=e.getAttribute(a,2);
var b=d.getAttribute(a,2);
return(c==null||b==null||c==b);
},getHtmlContent:function(g){var e=this._getElements(g,"span");
if(e){var a,c=e.length;
var d=[];
for(a=0;
a<c;
a++){var b=e[a];
var f=b.tagName.toLowerCase();
if(b.parentNode.tagName.toLowerCase()==f){if(this._singleChild(b)){d[d.length]=b;
}else{var h=Telerik.Web.UI.Editor.Utils.getOuterHtml(b).toLowerCase();
if(h.indexOf("<"+f+">")==0){d[d.length]=b;
}}}}c=d.length;
for(a=0;
a<c;
a++){this._optimizeElement(d[a]);
}}return g;
}};
Telerik.Web.UI.Editor.OptimizeSpans.registerClass("Telerik.Web.UI.Editor.OptimizeSpans",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEKeepCommentsFilter=function(){Telerik.Web.UI.Editor.IEKeepCommentsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEKeepCommentsFilter";
this.Description="This filter keeps the conditional comments in IE.";
};
Telerik.Web.UI.Editor.IEKeepCommentsFilter.prototype={getHtmlContent:function(a){var b=new RegExp("<!--RADEDITORSAVEDCOMMENT","ig");
var c=a.replace(b,"<!--");
return c;
},getDesignContent:function(a){var c=new RegExp("<!--(\\[[^]]+\\][\\s\\S]*?)-->","ig");
var b=a.replace(c,"<!--RADEDITORSAVEDCOMMENT$1-->");
return b;
}};
Telerik.Web.UI.Editor.IEKeepCommentsFilter.registerClass("Telerik.Web.UI.Editor.IEKeepCommentsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter=function(){Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEKeepObjectParamsFilter";
this.Description="This filter keeps the params of object tags when going to html mode and back.";
this._paramRegex=new RegExp("<param([\\s\\S]+?)/?>","ig");
};
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.prototype={getHtmlContent:function(b){var d=new RegExp("<rade_param","ig");
var e=this._paramRegex.test(b);
var a=d.test(b);
var c=b;
if(e&&a){c=c.replace(this._paramRegex,"");
}if(a){c=c.replace(d,"<param");
c=c.replace(/>\s*<\/rade_param>/gi,"/>");
c=c.replace(this._paramRegex,"<param$1/>");
}return c;
},getDesignContent:function(a){var b=a.replace(this._paramRegex,"<rade_param$1></rade_param><param$1/>");
return b;
}};
Telerik.Web.UI.Editor.IEKeepObjectParamsFilter.registerClass("Telerik.Web.UI.Editor.IEKeepObjectParamsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEKeepObjectDesignFilter=function(){Telerik.Web.UI.Editor.IEKeepObjectDesignFilter.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="IEKeepObjectDesignFilter";
this.Description="This filter keeps the browser from automatically changing object tags when going to html mode and back.";
};
Telerik.Web.UI.Editor.IEKeepObjectDesignFilter.prototype={getHtmlContent:function(b){var d=b.getElementsByTagName("object");
for(var f=0,a=d.length;
f<a;
f++){var c=d[f];
var e=c.getAttribute("data",2);
var g=c.getAttribute("type",2);
if(e&&g&&g.toLowerCase().indexOf("silverlight")!=-1&&e.toLowerCase().indexOf("base64")!=-1){c.setAttribute("data","data:"+g+",");
}}return b;
}};
Telerik.Web.UI.Editor.IEKeepObjectDesignFilter.registerClass("Telerik.Web.UI.Editor.IEKeepObjectDesignFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FixEnclosingP=function(){Telerik.Web.UI.Editor.FixEnclosingP.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="FixEnclosingP";
this.Description="This filter removes a parent paragraph tag if the whole content is inside it.";
};
Telerik.Web.UI.Editor.FixEnclosingP.prototype={getHtmlContent:function(b){var a=null;
if(b.tagName.toLowerCase()=="html"){a=b.getElementsByTagName("BODY")[0];
}else{a=b;
}if($telerik.isIE){if(a&&(a.firstChild)&&("P"==a.firstChild.tagName)&&(a.childNodes.length==1)&&(a.innerHTML.substring(0,3).toLowerCase()=="<p>")){Telerik.Web.UI.Editor.Utils.removeNode(a.firstChild);
}}return b;
}};
Telerik.Web.UI.Editor.FixEnclosingP.registerClass("Telerik.Web.UI.Editor.FixEnclosingP",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IEFixEmptyParagraphs=function(){Telerik.Web.UI.Editor.IEFixEmptyParagraphs.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IEFixEmptyParagraphs";
this.Description="This filter inserts a non-braking space in empty paragraph tags so they are rendered correctly in IE.";
};
Telerik.Web.UI.Editor.IEFixEmptyParagraphs.prototype={getHtmlContent:function(a){var c=new RegExp("(<p[^>]*>)(<\\/p>)","ig");
var b=a.replace(c,"$1&nbsp;$2");
return b;
}};
Telerik.Web.UI.Editor.IEFixEmptyParagraphs.registerClass("Telerik.Web.UI.Editor.IEFixEmptyParagraphs",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IECleanAnchorsFilter=function(){Telerik.Web.UI.Editor.IECleanAnchorsFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="IECleanAnchorsFilter";
this.Description="This filter removse the current page href from all anchor (#) links .";
};
Telerik.Web.UI.Editor.IECleanAnchorsFilter.prototype={getHtmlContent:function(a){var c=Telerik.Web.UI.Editor.Utils.escapeRegExSpecialChars(document.location.href);
var d=new RegExp("(<A[^<>]*?(href)\\s*=\\s*['\"])("+c+")(\\#[^'\"]*?['\"][^>]*?>)","ig");
var b=a.replace(d,"$1$4");
return b;
}};
Telerik.Web.UI.Editor.IECleanAnchorsFilter.registerClass("Telerik.Web.UI.Editor.IECleanAnchorsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozEmStrongFilter=function(){Telerik.Web.UI.Editor.MozEmStrongFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="MozEmStrongFilter";
this.Description="This filter changes b,strong and i,em in Mozilla browsers.";
};
Telerik.Web.UI.Editor.MozEmStrongFilter.prototype={getHtmlContent:function(a){var b=a.replace(new RegExp("<b(\\s([^>])*?)?>","ig"),"<strong$1>");
b=b.replace(new RegExp("</b(\\s([^>])*?)?>","ig"),"</strong$1>");
b=b.replace(new RegExp("<i(\\s([^>])*?)?>","ig"),"<em$1>");
b=b.replace(new RegExp("</i(\\s([^>])*?)?>","ig"),"</em$1>");
return b;
},getDesignContent:function(a){var b=a.replace(new RegExp("<strong(\\s([^>])*?)?>","ig"),"<b$1>");
b=b.replace(new RegExp("</strong(\\s([^>])*?)?>","ig"),"</b$1>");
b=b.replace(new RegExp("<em(\\s([^>])*?)?>","ig"),"<i$1>");
b=b.replace(new RegExp("</em(\\s([^>])*?)?>","ig"),"</i$1>");
return b;
}};
Telerik.Web.UI.Editor.MozEmStrongFilter.registerClass("Telerik.Web.UI.Editor.MozEmStrongFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepStylesString=function(){Telerik.Web.UI.Editor.MozillaKeepStylesString.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="MozillaKeepStylesString";
this.Description="This filter remembers the positions of link tags in the html content (part 1).";
this.markerCounter=0;
};
Telerik.Web.UI.Editor.MozillaKeepStylesString.prototype={getDesignContent:function(b){var d=this;
var c=function(m,i,g,o,f){var h=f.indexOf("</head>",o);
if(h!=-1&&f.indexOf("<body",h)!=-1){return m;
}else{d.markerCounter++;
var k="RadEditorStyleKeeper"+d.markerCounter;
var n="<div id='"+k+"' style='display:none;'>&nbsp;</div><"+i+" reoriginalpositionmarker='"+k+"'"+g;
return n;
}};
var a=new RegExp("<(link|style)([^>]*>)","gi");
var e=b.replace(a,c);
return e;
},getHtmlContent:function(b){var a=new RegExp("<(link|style) reoriginalpositionmarker='RadEditorStyleKeeper[^']+'([^>]*>)","gi");
var c=b.replace(a,"<$1$2");
var d=new RegExp("<div id='RadEditorStyleKeeper[^']+' style='display:none;'>&nbsp;</div>","gi");
c=c.replace(d,"");
return c;
}};
Telerik.Web.UI.Editor.MozillaKeepStylesString.registerClass("Telerik.Web.UI.Editor.MozillaKeepStylesString",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepStylesDom=function(){Telerik.Web.UI.Editor.MozillaKeepStylesDom.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="MozillaKeepStylesDom";
this.Description="This filter remembers the positions of link tags in the html content(part 2).";
this._divs=[];
};
Telerik.Web.UI.Editor.MozillaKeepStylesDom.prototype={getHtmlContent:function(b){var a=b.getElementsByTagName("HEAD")[0];
var e=true;
if(!a){a=b.ownerDocument.getElementsByTagName("HEAD")[0];
e=false;
}if(!a){return b;
}this._restoreElements(a,b,"STYLE");
this._restoreElements(a,b,"LINK");
var g=b.getElementsByTagName("DIV");
if(g){for(var d=g.length-1;
d>=0;
d--){var c=g[d];
if(c.id.indexOf("RadEditorStyleKeeper")==0){var f=c.parentNode;
f.removeChild(c);
}}}g=null;
if(e){this._removeElements(a,"STYLE");
this._removeElements(a,"LINK");
}this._removeMarkerAttributes(b,"STYLE");
this._removeMarkerAttributes(b,"LINK");
return b;
},_restoreElements:function(a,b,d){var e;
e=a.getElementsByTagName(d);
this._divs=b.getElementsByTagName("DIV");
var c=0;
while(e.length>0&&c<e.length){this._restoreStyle(e[c++]);
}},_restoreStyle:function(d){var a=d.getAttribute("reoriginalpositionmarker");
if(a){j=0;
var b=null;
while(j<this._divs.length&&!b){if(this._divs[j].id==a){b=this._divs[j];
}j++;
}if(b){var e=d.cloneNode(true);
e.removeAttribute("reoriginalpositionmarker");
var c=b.parentNode;
c.replaceChild(e,b);
return true;
}}return false;
},_removeElements:function(a,e){var b=a.getElementsByTagName(e);
if(b){for(var d=b.length-1;
d>=0;
d--){var c=b[d];
if(null!=c.getAttribute("reoriginalpositionmarker")){var f=c.parentNode;
f.removeChild(c);
}}b=null;
}},_removeMarkerAttributes:function(a,d){var b=a.getElementsByTagName(d);
if(b){for(var c=b.length-1;
c>=0;
c--){b[c].removeAttribute("reoriginalpositionmarker");
}}b=null;
}};
Telerik.Web.UI.Editor.MozillaKeepStylesDom.registerClass("Telerik.Web.UI.Editor.MozillaKeepStylesDom",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MozillaKeepFlash=function(a){Telerik.Web.UI.Editor.MozillaKeepFlash.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="MozillaKeepFlash";
this.Description="This filter replaces the flash/media objects with static images in design mode.";
this._flashImageSrc=a?a:"FlashManager.gif";
};
Telerik.Web.UI.Editor.MozillaKeepFlash.prototype={_saveFlashObject:function(f){var c=f.ownerDocument.createElement("img");
c.setAttribute("isflash","true");
c.setAttribute("src",this._flashImageSrc);
c.setAttribute("alt","");
var d=f.getAttribute("width",2);
if(d){c.setAttribute("width",d);
}var a=f.getAttribute("height",2);
if(a){c.setAttribute("height",a);
}var b=$telerik.getOuterHtml(f);
b=b.replace(/\n/gi,"<flashcr />").replace(/\r/gi,"<flashlf />");
c.setAttribute("originalCode",Telerik.Web.UI.Editor.Utils.encodePostbackContent(b));
var e=f.parentNode;
e.insertBefore(c,f);
e.removeChild(f);
f=null;
},_restoreFlashObject:function(g){var c=Telerik.Web.UI.Editor.Utils.decodePostbackContent(g.getAttribute("originalCode"));
c=c.replace(/\<flashcr\s*\/\>/gi,"\n").replace(/\<flashlf\s*\/\>/gi,"\r");
var b=g.ownerDocument.createElement("DIV");
b.innerHTML=c;
var f=b.firstChild;
var d=g.getAttribute("width",2);
if(d){f.setAttribute("width",d);
}var a=g.getAttribute("height",2);
if(a){f.setAttribute("height",a);
}var e=g.parentNode;
e.insertBefore(f,g);
e.removeChild(g);
g=null;
},getDesignContent:function(a){var c;
var b=a.getElementsByTagName("object");
for(c=0;
c<b.length;
c++){var d=b[c];
this._saveFlashObject(d);
c--;
}var b=a.getElementsByTagName("embed");
for(c=0;
c<b.length;
c++){var d=b[c];
this._saveFlashObject(d);
c--;
}return a;
},getHtmlContent:function(b){var c=b.getElementsByTagName("img");
for(var d=0;
d<c.length;
d++){var e=c[d];
var a=e.getAttribute("isflash",2);
if(a!=null){this._restoreFlashObject(e);
d--;
}}return b;
}};
Telerik.Web.UI.Editor.MozillaKeepFlash.registerClass("Telerik.Web.UI.Editor.MozillaKeepFlash",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.StripJunkFilter=function(){Telerik.Web.UI.Editor.StripJunkFilter.initializeBase(this);
this.IsDom=false;
this.Enabled=true;
this.Name="StripJunkFilter";
this.Description="This filter strips extra content, added by the Safari/Firefox browsers.";
};
Telerik.Web.UI.Editor.StripJunkFilter.prototype={getHtmlContent:function(a){var b=a;
if($telerik.isSafari){b=b.replace(new RegExp(' class="khtml-block-placeholder"',"ig"),"");
b=b.replace(new RegExp(' class="Apple-style-span"',"ig"),"");
b=b.replace(new RegExp(' class="webkit-block-placeholder"',"ig"),"");
}if($telerik.isFirefox){b=b.replace(new RegExp('\\s?<br type="_moz" \\/>',"ig")," ");
b=b.replace(new RegExp(' _moz_[a-z_]*="[^"]*"',"ig"),"");
b=b.replace(new RegExp(' type="_moz"',"ig"),"");
}return b;
}};
Telerik.Web.UI.Editor.StripJunkFilter.registerClass("Telerik.Web.UI.Editor.StripJunkFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.ConvertFontToSpanFilter=function(){Telerik.Web.UI.Editor.ConvertFontToSpanFilter.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="ConvertFontToSpanFilter";
this.Description="This filter changes deprecated font tags to compliant span tags.";
this._fontSizesPx=["10px","13px","16px","18px","24px","32px","48px"];
this._fontSizesRevPx=[];
for(var a=0;
a<this._fontSizesPx.length;
a++){this._fontSizesRevPx[parseInt(this._fontSizesPx[a])]=a;
}};
Telerik.Web.UI.Editor.ConvertFontToSpanFilter.prototype={getHtmlContent:function(i){var b=i.ownerDocument;
var e=b.createElement("SPAN");
var a,h,f;
var g=i.getElementsByTagName("FONT");
while(g.length>0){h=g[0];
f=h.parentNode;
a=e.cloneNode(false);
$telerik.mergeElementAttributes(h,a,false);
if(h.style.cssText&&h.style.cssText!=""){a.style.cssText=h.style.cssText;
}if(h.className){a.className=h.className;
}if(h.face){a.style.fontFamily=h.face;
if(a.getAttribute("face")!=null){a.removeAttribute("face");
}}var d=0;
if(h.style.fontSize){a.style.fontSize=h.style.fontSize;
}else{if(!isNaN(d=parseInt(h.size))&&h.size!="+0"){try{if(d<0){d=d+4;
}a.style.fontSize=this._fontSizesPx[d-1];
}catch(c){a.style.fontSize=this._fontSizesPx[3];
}if(a.getAttribute("size")!=null){a.removeAttribute("size");
}}}if(h.color){a.style.color=h.color;
if(a.getAttribute("color")!=null){a.removeAttribute("color");
}}if($telerik.isIE&&h.innerHTML==" "){a.innerText=h.innerHTML;
}else{Telerik.Web.UI.Editor.Utils.setElementInnerHtml(a,h.innerHTML);
}f.replaceChild(a,h);
g=i.getElementsByTagName("FONT");
}return i;
},getDesignContent:function(g){if($telerik.isSafari2||$telerik.isSafari3){return g;
}var b=g.ownerDocument;
var h=b.createElement("FONT");
var a,f,e;
var c=g.getElementsByTagName("SPAN");
while(c.length>0){a=c[0];
e=a.parentNode;
f=h.cloneNode(false);
$telerik.mergeElementAttributes(a,f,false);
if(a.style.cssText&&a.style.cssText!=""){f.style.cssText=a.style.cssText;
}if(a.className){f.className=a.className;
}if(a.style.fontFamily){f.face=a.style.fontFamily;
this._removeElementStyleAttribute(f,"fontFamily");
}if(a.style.fontSize){var d=3;
var i=null;
if(-1!=a.style.fontSize.indexOf("px")){i=this._fontSizesRevPx[parseInt(a.style.fontSize)];
}if(typeof(i)!="undefined"&&null!=i){f.size=i+1;
this._removeElementStyleAttribute(f,"fontSize");
}}if(a.style.color){f.color=Telerik.Web.UI.Editor.Utils._rgbToHex(a.style.color);
this._removeElementStyleAttribute(f,"color");
}if($telerik.isIE&&a.innerHTML==" "){f.innerText=a.innerHTML;
}else{Telerik.Web.UI.Editor.Utils.setElementInnerHtml(f,a.innerHTML);
}e.replaceChild(f,a);
c=g.getElementsByTagName("SPAN");
}return g;
},_removeElementStyleAttribute:function(b,a){if(b.style&&b.style[a]){if(b.style.removeAttribute){b.style.removeAttribute(a);
}else{if(b.style.removeProperty){a=a.replace(/([A-Z])/g,"-$1").toLowerCase();
b.style.removeProperty(a);
}}if(b.style[a]){b.style[a]=null;
}if(b.style.cssText){}else{b.removeAttribute("style");
}}}};
Telerik.Web.UI.Editor.ConvertFontToSpanFilter.registerClass("Telerik.Web.UI.Editor.ConvertFontToSpanFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.CleanAttributesFilter=function(){Telerik.Web.UI.Editor.CleanAttributesFilter.initializeBase(this);
this.IsDom=true;
this.Enabled=true;
this.Name="CleanAttributesFilter";
this.Description="This filter fixes deprecated attributes to make the content XHTML compliant.";
};
Telerik.Web.UI.Editor.CleanAttributesFilter.prototype={_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},getHtmlContent:function(g){var d=g;
var e;
var h=d.getElementsByTagName("body");
var f=h.length;
for(e=0;
e<f;
e++){var a=h[e];
this.convertAttribute(a,"bgColor","backgroundColor");
this.convertAttribute(a,"background","backgroundImage");
}var h=d.getElementsByTagName("p");
var f=h.length;
for(e=0;
e<f;
e++){this.convertAttribute(h[e],"align","textAlign");
}for(var c=1;
c<7;
c++){var h=d.getElementsByTagName("H"+c);
for(e=0,l=h.length;
e<l;
e++){this.convertAttribute(h[e],"align","textAlign");
}}var h=d.getElementsByTagName("div");
var f=h.length;
for(e=0;
e<f;
e++){this.convertAttribute(h[e],"align","textAlign");
}h=d.getElementsByTagName("table");
f=h.length;
for(e=0;
e<f;
e++){var a=h[e];
this.convertAttribute(a,"bgColor","backgroundColor");
this.convertAttribute(a,"background","backgroundImage");
}h=d.getElementsByTagName("td");
f=h.length;
for(e=0;
e<f;
e++){var a=h[e];
this.convertAttribute(a,"bgColor","backgroundColor");
this.convertAttribute(a,"background","backgroundImage");
this.convertAttribute(a,"borderColor","borderColor");
this.convertAttribute(a,"width","width");
this.convertAttribute(a,"height","height");
this.convertAttribute(a,"noWrap","whiteSpace");
}h=d.getElementsByTagName("img");
f=h.length;
for(e=0;
e<f;
e++){var a=h[e];
this.convertImgAlignAttribute(a);
var b=new Array("marginLeft","marginRight");
this.convertAttribute(a,"hspace",b);
b=new Array("marginTop","marginBottom");
this.convertAttribute(a,"vspace",b);
this.convertBorderAttribute(a);
}h=d.getElementsByTagName("ul");
f=h.length;
for(e=0;
e<f;
e++){this.convertTypeAttribute(h[e]);
}h=d.getElementsByTagName("ol");
f=h.length;
for(e=0;
e<f;
e++){this.convertTypeAttribute(h[e]);
}return d;
},getDesignContent:function(b){var d=b;
var e;
var c=d.getElementsByTagName("p");
var f=c.length;
for(e=0;
e<f;
e++){this.convertCSSProperty(c[e],"align","textAlign");
}for(var a=1;
a<7;
a++){var c=d.getElementsByTagName("H"+a);
for(e=0,l=c.length;
e<l;
e++){this.convertCSSProperty(c[e],"align","textAlign");
}}c=d.getElementsByTagName("div");
f=c.length;
for(e=0;
e<f;
e++){this.convertCSSProperty(c[e],"align","textAlign");
}c=d.getElementsByTagName("img");
f=c.length;
for(e=0;
e<f;
e++){var g=c[e];
this.convertBorderCSS(g);
}return d;
},convertAttribute:function(g,e,b){var d=g.getAttribute(e);
var a=d;
if(e=="background"){d=g.getAttribute(e,2);
a="url("+d+")";
}else{if(e=="width"||e=="height"||e=="vspace"||e=="hspace"){if(!(typeof(a)=="string"&&a.match("%"))){a=parseInt(a)+"px";
}}else{if(e=="noWrap"){d=g.noWrap;
a="nowrap";
}}}if(d){if(typeof(b)=="object"){var f=b.length;
for(var c=0;
c<f;
c++){pValue=g.style[b[c]];
if(!pValue){g.style[b[c]]=a;
}}}else{pValue=g.style[b];
if(!pValue){g.style[b]=a;
}}g.removeAttribute(e);
}},convertCSSProperty:function(a,f,b){var e=a.getAttribute(f);
var c=a.style[b];
var h=c;
if(b=="backgroundImage"){h=c.slice(4,c.length-1);
}else{if(b=="width"||b=="height"){if(c&&!c.match("%")){h=parseInt(c);
}}else{if(b=="whiteSpace"){e=a.noWrap;
h="nowrap";
}else{if(f=="vspace"||f=="hspace"){var g=b.length;
for(var d=0;
d<g;
d++){if(d==0){c=a.style[b[d]];
h=parseInt(c);
}else{if(c!=a.style[b[d]]){c=false;
break;
}}}}}}}if(c&&!e){a.setAttribute(f,h);
if(typeof(b)=="object"){g=b.length;
for(var d=0;
d<g;
d++){a.style[b[d]]="";
}}else{a.style[b]="";
}}},convertImgAlignAttribute:function(c){var a=c.getAttribute("align");
var b=($telerik.isIE)?"styleFloat":"cssFloat";
if(a){a=a.toLowerCase();
c.style.verticalAlign="";
c.style[b]="";
switch(a){case"left":c.style[b]="left";
break;
case"right":c.style[b]="right";
break;
case"bottom":case"baseline":case"absbottom":c.style[b]="";
c.style.verticalAlign="text-bottom";
break;
case"middle":case"absmiddle":c.style[b]="";
c.style.verticalAlign="middle";
break;
case"top":case"texttop":c.style[b]="";
c.style.verticalAlign="top";
break;
}}c.removeAttribute("align");
},convertTypeAttribute:function(b){var a=b.getAttribute("type");
if(a){if(!b.style.listStyleType){switch(a){case"1":b.style.listStyleType="decimal";
break;
case"a":b.style.listStyleType="lower-alpha";
break;
case"A":b.style.listStyleType="upper-alpha";
break;
case"i":b.style.listStyleType="lower-roman";
break;
case"I":b.style.listStyleType="upper-roman";
break;
case"disc":b.style.listStyleType="disc";
break;
case"circle":b.style.listStyleType="circle";
break;
case"square":b.style.listStyleType="square";
break;
}}b.removeAttribute("type");
}},convertListStyleTypeStyle:function(c){var a=c.style.listStyleType;
var b=c.getAttribute("type");
if(a&&!b){switch(a){case"decimal":c.type="1";
break;
case"lower-alpha":c.type="a";
break;
case"upper-alpha":c.type="A";
break;
case"lower-roman":c.type="i";
break;
case"upper-roman":c.type="I";
break;
case"disc":c.type="disc";
break;
case"circle":c.type="circle";
break;
case"square":c.type="square";
break;
default:c.type=a;
break;
}c.style.listStyleType="";
}},convertBorderAttribute:function(c){var a=c.getAttribute("border");
if(a){if(!c.style.borderWidth){c.style.borderWidth=a+"px";
}if(!c.style.borderStyle){c.style.borderStyle="solid";
}c.removeAttribute("border");
}},convertBorderCSS:function(d){var c=parseInt(d.style.borderWidth);
var a=d.getAttribute("border");
if(c&&d.style.borderStyle.match("solid")&&(!a||a==0)){d.setAttribute("border",c);
d.style.borderWidth="";
d.style.borderStyle="";
}}};
Telerik.Web.UI.Editor.CleanAttributesFilter.registerClass("Telerik.Web.UI.Editor.CleanAttributesFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.ConvertToXhtmlFilter=function(){Telerik.Web.UI.Editor.ConvertToXhtmlFilter.initializeBase(this);
this._uniqueIds={};
this.Name="ConvertToXhtmlFilter";
this.Description="This filter converts the HTML from the editor content area to valid XHTML";
this.Enabled=true;
this.IsDom=true;
};
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.prototype={getHtmlContent:function(b){if(!b){return"";
}this._removeLastBr(b);
var a=new Telerik.Web.StringBuilder();
this._appendNodeXhtml(b,a);
return a.toString();
},_removeLastBr:function(c){if(!c||$telerik.isIE){return;
}var a=(c.tagName=="HTML")?c.getElementsByTagName("BODY")[0]:c;
var b=(a.lastChild)?a.lastChild:null;
if(b&&b.tagName&&"BR"==b.tagName){Telerik.Web.UI.Editor.Utils.removeNode(b);
}},_convertAttribute:function(a){return String(a).replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;");
},_getAttributeValue:function(c,d,b){var a=c.nodeName;
var f=c.nodeValue;
if(a!="style"){if(($telerik.isIE8&&a=="complete"&&f=="complete")||($telerik.isIE8&&a=="shape"&&d.nodeName.toLowerCase()=="a"&&d[a]!=d.getAttribute(a))||($telerik.isIE8&&a.toLowerCase()=="althtml"&&d.nodeName.toLowerCase()=="object")){return;
}if($telerik.isIE&&(a=="type"||a=="value"||a=="selected")){if(!f){return;
}}else{if(!c.specified){if($telerik.isIE&&f==""&&typeof(d[a])=="string"&&d[a]!=""){f=d[a];
}else{return;
}}}if(!f){return;
}if(!isNaN(f)){f=d.getAttribute(a);
}if($telerik.isIE&&(a=="href"||a=="src")){f=d.getAttribute(a,2);
}b.append(" "+(c.expando?a:a.toLowerCase())+'="'+this._convertAttribute(f)+'"');
}else{var e=d.style.cssText;
if(e){e=this._convertRgbToHex(e);
e=this._stripBorderRepetition(e);
b.append(' style="'+this._convertAttribute(e.toLowerCase())+'"');
}}},_convertRgbToHex:function(a){if($telerik.isFirefox||$telerik.isSafari){a=a.replace(/rgb *\( *\d+ *, *\d+ *, *\d+ *\)/gi,function(b,c,d){return Telerik.Web.UI.Editor.Utils._rgbToHex(b);
});
}return a;
},_replaceBorderRepetition:function(e,a,c){var b=e.match(a);
if(b&&b.length==4){var d=b[0].substring(b[0].indexOf(":"));
if(d==b[1].substring(b[1].indexOf(":"))&&d==b[2].substring(b[2].indexOf(":"))&&d==b[3].substring(b[3].indexOf(":"))){e=e.replace(a,"").replace(/^\s+|\s+$/g,"");
e+=c+d;
}}return e;
},_combineBorderStyles:function(f){var b=new RegExp(/border-(width|style|color):([^;]*);/gi);
var d=f.match(b);
if(d&&d.length==3){var c="border:";
var e=[];
e[0]=d[0].substring(d[0].indexOf(":")+1);
e[1]=d[1].substring(d[1].indexOf(":")+1);
e[2]=d[2].substring(d[2].indexOf(":")+1);
var a=function(g){for(var h=0;
h<3;
h++){if(d[h].indexOf(g)==0){c+=e[h]+" ";
break;
}}};
a("border-width");
a("border-style");
a("border-color");
c=c.replace(/;/g,"").replace(/currentcolor/gi,"").replace(/initial/gi,"").replace("s[s]+"," ").replace(/^\s+|\s+$/g,"");
c+=";";
f=f.replace(b,"");
f=c+f;
}return f;
},_stripBorderRepetition:function(b){if(!b){return;
}if(!b.match(/; *$/)){b+=";";
}var a=new RegExp(/border(?:-(top|bottom|left|right))-width:([^;]*);/gi);
b=this._replaceBorderRepetition(b,a,"border-width");
var a=new RegExp(/border(?:-(top|bottom|left|right))-style:([^;]*);/gi);
b=this._replaceBorderRepetition(b,a,"border-style");
var a=new RegExp(/border(?:-(top|bottom|left|right))-color:([^;]*);/gi);
b=this._replaceBorderRepetition(b,a,"border-color");
var a=new RegExp(/border-(top|bottom|left|right):([^;]*);/gi);
b=this._replaceBorderRepetition(b,a,"border");
b=this._combineBorderStyles(b);
return b.replace(/^\s+|\s+$/g,"");
},_canHaveChildren:function(a){switch(a.tagName.toUpperCase()){case"AREA":case"BASE":case"BASEFONT":case"COL":case"FRAME":case"HR":case"IMG":case"BR":case"INPUT":case"ISINDEX":case"LINK":case"META":case"PARAM":return false;
}return true;
},_appendElementNode:function(b,a){if(b.tagName.charAt(0)=="/"){if($telerik.isIE6&&b.nodeName=="/ABBR"){a.append("</abbr>");
}return;
}if(b.nodeName=="!"){a.append(b.text);
return;
}var c=b.nodeName;
if(b.scopeName){if(b.scopeName=="HTML"){c=c.toLowerCase();
}else{c=b.scopeName+":"+c;
}}else{c=c.toLowerCase();
}if($telerik.isFirefox&&c=="br"&&b.parentNode.nodeName.toLowerCase()=="pre"){if(b.getAttribute("_moz_dirty")==""){a.append("\r\n");
return;
}}a.append("<"+c);
if("img"==c){if($telerik.isIE6||$telerik.isIE7){var h=document.createElement("IMG");
h.mergeAttributes(b);
if(h.width){a.append(' width="'+b.getAttribute("width",2)+'"');
}if(h.height){a.append(' height="'+b.getAttribute("height",2)+'"');
}}if(!b.getAttribute("alt",2)){a.append(' alt=""');
}}if($telerik.isIE&&("area"==c||"a"==c)){if(b.shape&&c=="area"&&!document.documentMode){a.append(' shape="'+b.shape.toLowerCase()+'"');
}if(b.coords&&c=="area"&&!document.documentMode){a.append(' coords="'+b.getAttribute("coords")+'"');
}var m=b.getAttribute("href",2);
if(m){m=m.replace("about:blank","");
m=m.replace("about:","");
m=m.replace(/&amp;/gi,"&").replace(/&/gi,"&amp;");
a.append(' href="'+m+'"');
b.removeAttribute("href",0);
}}if($telerik.isIE8&&"option"==c&&b.selected){a.append(' selected="selected"');
}try{var f=b.attributes;
var d=f.length;
for(var p=0;
p<d;
p++){this._getAttributeValue(f[p],b,a);
}}catch(k){if($telerik.isIE&&k.message.indexOf("Not enough storage is available to complete this operation")!=-1){var e=b.outerHTML.replace(/^\s+/gi,"");
e=e.replace(/^([^\s]+)([^>]+?)>[\s\S]+$/gi,"$2");
a.append(e);
}}switch(c){case"script":a.append(">"+b.text+"</"+c+">");
break;
case"textarea":a.append(">"+b.value+"</"+c+">");
break;
case"iframe":var g=b.innerHTML;
if($telerik.isIE){g=g.replace(/\soriginalAttribute="[^"]+"/gi,"");
g=g.replace(/\soriginalPath="[^"]+"/gi,"");
}if($telerik.isFirefox){g=g.replace(/\&amp;/g,"&").replace(/\&lt;/g,"<").replace(/\&gt;/g,">").replace(/\&quot;/g,'"');
}a.append(">"+g+"</iframe>");
break;
case"object":a.append(">");
var n="";
if(b.altHtml){n=b.altHtml;
}else{n=b.innerHTML;
}if($telerik.isIE){n=n.replace(/\soriginalAttribute="[^"]+"/gi,"");
n=n.replace(/\soriginalPath="[^"]+"/gi,"");
}a.append(n);
a.append("</object>");
break;
case"title":case"style":case"comment":case"noscript":var n=b.innerHTML;
if($telerik.isIE&&n.length==0){n=b.ownerDocument.title;
}a.append(">"+n+"</"+c+">");
break;
default:if(b.hasChildNodes()||(true==b.canHaveChildren||(b.canHaveChildren==null&&this._canHaveChildren(b)))){a.append(">");
var o=b.childNodes;
d=o.length;
for(var p=0;
p<d;
p++){this._appendNodeXhtml(o[p],a);
}a.append("</"+c+">");
}else{if($telerik.isIE6&&c=="abbr"){a.append(">");
}else{a.append(" />");
}}break;
}},_appendTextNode:function(d,b){var a=String(d.nodeValue);
var c=d.parentNode.nodeName.toLowerCase();
if(!$telerik.isIE&&(c=="style"||c=="script")){b.append(a);
}else{a=a.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
a=a.replace(/[\u00a0]/g,"&nbsp;");
b.append(a);
}},_appendCDataNode:function(b,a){a.append("<![CDATA[\n"+b.nodeValue+"\n]]>");
},_appendCommentNode:function(d,c){var a="";
try{a=d.nodeValue;
}catch(b){}if(!a&&d.text){a=d.text;
}else{a="<!--"+a+"-->";
}c.append(a);
},_appendNodeXhtml:function(b,a){if(b.uniqueID){if(this._uniqueIds[b.uniqueID]){return;
}else{this._uniqueIds[b.uniqueID]=true;
}}switch(b.nodeType){case 1:this._appendElementNode(b,a);
break;
case 3:this._appendTextNode(b,a);
break;
case 4:this._appendCDataNode(b,a);
break;
case 8:this._appendCommentNode(b,a);
break;
}}};
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.registerClass("Telerik.Web.UI.Editor.ConvertToXhtmlFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.IndentHTMLContentFilter=function(){Telerik.Web.UI.Editor.IndentHTMLContentFilter.initializeBase(this);
this.Name="IndentHTMLContentFilter";
this.Description="This filter indents the HTML content so it is more readable when you view the code";
this.Enabled=true;
this.IsDom=false;
this._indentPattern="    ";
this._protectedData=null;
var c="P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION";
var b="HTML|HEAD|BODY|STYLE|FORM|TABLE|TBODY|THEAD|TR";
var a=b+"|DL|UL|OL";
this._ignoreTags=new RegExp("(<PRE[^>]*>|<!--|<SCRIPT[^>]*>)([\\s\\S]*?)(<\\/PRE>|-->|<\\/SCRIPT>)","gi");
this._tagsNLBefore=new RegExp("<("+c+")[^>]*>","gi");
this._tagsNLAfter=new RegExp("<\\/("+c+")[^>]*>","gi");
this._tagsNLNoCloseAfter=new RegExp("<(BR|HR)[^>]*\\/?>","gi");
this._tagsNLBeforeAndAfter=new RegExp("<\\/?("+b+")[^>]*>","gi");
this._tagsIncIndent=new RegExp("^<("+a+")[\\s\\/>]","i");
this._tagsDecIndent=new RegExp("^<\\/("+a+")[\\s\\>]","i");
this._shrinkNL=new RegExp("\\s*\\n+\\s*","gi");
};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.prototype={getHtmlContent:function(d){var f=d.trim();
if(f.indexOf("<body")==0){f=f.substring(f.indexOf(">")+1,f.length-7);
}this._protectedData=[];
var o=this;
var h=function(q,i,p,r,s,t){Array.add(o._protectedData,p);
return i+"RADEDITORFORMATTED_"+o._protectedData.length+r;
};
f=f.replace(this._ignoreTags,h);
var m="$&";
if($telerik.isSafari2){m="$0";
}f=f.replace(this._tagsNLBefore,"\n"+m);
f=f.replace(this._tagsNLAfter,m+"\n");
f=f.replace(this._tagsNLNoCloseAfter,m+"\n");
f=f.replace(this._tagsNLBeforeAndAfter,"\n"+m+"\n");
var n=f.split(this._shrinkNL);
var e=new Telerik.Web.StringBuilder();
var b="";
for(var a=0;
a<n.length;
a++){var c=n[a];
if(c.length==0){continue;
}if(this._tagsDecIndent.test(c)){if(b.length>this._indentPattern.length){b=b.substring(this._indentPattern.length);
}else{b="";
}}e.append(b);
e.append(c);
e.append("\n");
if(this._tagsIncIndent.test(c)){b+=this._indentPattern;
}}f=e.toString();
for(var a=0;
a<this._protectedData.length;
a++){var g=new RegExp("RADEDITORFORMATTED_"+(a+1));
var k=this._protectedData[a].replace(/\$/gi,"$$$$");
f=f.replace(g,k);
}return f;
}};
Telerik.Web.UI.Editor.IndentHTMLContentFilter.registerClass("Telerik.Web.UI.Editor.IndentHTMLContentFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.MakeUrlsAbsolute=function(){Telerik.Web.UI.Editor.MakeUrlsAbsolute.initializeBase(this);
this.Name="MakeUrlsAbsolute";
this.Description="This filter makes all src and href attributes in the editor content have absolute URLs";
this.Enabled=true;
this.IsDom=true;
};
Telerik.Web.UI.Editor.MakeUrlsAbsolute.prototype={getHtmlContent:function(a){this._updateElements(a,"A","href");
this._updateElements(a,"AREA","href");
this._updateElements(a,"IMG","src");
this._updateElements(a,"EMBED","src");
return a;
},_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},_updateElements:function(h,d,b){var e=h.ownerDocument.createElement("div");
var c=this._getElements(h,d);
if(c){for(var a=0;
a<c.length;
a++){var f=c[a].getAttribute(b,2);
if("href"==b&&f){e.innerHTML='<a href="'+f.replace(/\"/gi,"%22")+'">test</a>';
if($telerik.isIE){var g=c[a].innerHTML;
}c[a].setAttribute("href",e.childNodes[0].href);
if($telerik.isIE){if((g.indexOf("www.")==0&&c[a].innerHTML.match("[a-z]+://"))||(g.indexOf("mailto:")==-1&&c[a].innerHTML.match("mailto:"))){c[a].innerHTML=g;
}}}else{if("src"==b&&f){e.innerHTML='<img src="'+f.replace(/\"/gi,"%22")+'" />';
c[a].setAttribute("src",e.childNodes[0].src);
}}}}e.innerHTML="";
e=null;
}};
Telerik.Web.UI.Editor.MakeUrlsAbsolute.registerClass("Telerik.Web.UI.Editor.MakeUrlsAbsolute",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.StripPathsFilter=function(a){Telerik.Web.UI.Editor.StripPathsFilter.initializeBase(this);
this.Name="StripPathsFilter";
this.Description="This filter strips a specific part from URLs (href, src attributes)";
this.Enabled=true;
this.IsDom=true;
this._pathsToStrip=a;
};
Telerik.Web.UI.Editor.StripPathsFilter.prototype={getHtmlContent:function(a){this._updateElements(a,"A","href");
this._updateElements(a,"AREA","href");
this._updateElements(a,"IMG","src");
this._updateElements(a,"EMBED","src");
return a;
},_getElements:function(a,c){var b=a.getElementsByTagName(c);
if(!b){b=a.ownerDocument.getElementsByTagName(c);
}return b;
},_updateElements:function(m,e,c){var k=this._getElements(m,e);
if(k){for(var b=0;
b<k.length;
b++){var d=k[b];
var f=$telerik.isIE?d.getAttribute(c,2):d[c];
if(f){var n=f.length;
for(var a=0,g=this._pathsToStrip.length;
a<g;
a++){var h=this._pathsToStrip[a];
if(h&&f.toLowerCase().indexOf(h.toLowerCase())==0){f=f.substring(h.length);
}}if(n>f.length){d.setAttribute(c,f);
}}}}}};
Telerik.Web.UI.Editor.StripPathsFilter.registerClass("Telerik.Web.UI.Editor.StripPathsFilter",Telerik.Web.UI.Editor.Filter);
Telerik.Web.UI.Editor.FiltersManager=function(){Telerik.Web.UI.Editor.FiltersManager.initializeBase(this);
this._filters=[];
this._enableXhtmlFilter=true;
this._convertToXhtmlFilter=new Telerik.Web.UI.Editor.ConvertToXhtmlFilter();
};
Telerik.Web.UI.Editor.FiltersManager.prototype={clear:function(){Array.clear(this._filters);
},get_enableXhtmlFilter:function(){return this._enableXhtmlFilter;
},set_enableXhtmlFilter:function(a){this._enableXhtmlFilter=a;
},add:function(a){Array.add(this._filters,a);
},addAt:function(a,b){Array.insert(this._filters,b,a);
},remove:function(a){Array.remove(this._filters,a);
},removeAt:function(a){Array.removeAt(this._filters,a);
},getFilterAt:function(a){return this._filters[a];
},getFilterByName:function(a){for(var b=0;
b<this._filters.length;
b++){var c=this._filters[b];
if(c&&a==c.get_name()){return c;
}}},getDesignContent:function(a){var b=a;
for(var d=0;
d<this._filters.length;
d++){var e=this._filters[d];
if((!e.get_isDom())&&(false!=e.get_enabled())&&e.getDesignContent){try{b=e.getDesignContent(b);
}catch(c){alert("Error while executing filter "+e.get_name()+" - "+c.toString());
}}}return b;
},getDesignContentDom:function(a){for(var c=0;
c<this._filters.length;
c++){var d=this._filters[c];
if((d.get_isDom())&&(false!=d.get_enabled())&&d.getDesignContent){try{a=d.getDesignContent(a);
}catch(b){alert("Error while executing filter "+d.get_name()+" - "+b.toString());
}}}return a;
},getHtmlContent:function(c){for(var d=0;
d<this._filters.length;
d++){var e=this._filters[d];
if((e.get_isDom())&&(false!=e.get_enabled())&&e.getHtmlContent){try{c=e.getHtmlContent(c);
}catch(b){alert("Error while executing filter "+e.get_name()+" - "+b.toString());
}}}var a;
if(this.get_enableXhtmlFilter()){try{a=this._convertToXhtmlFilter.getHtmlContent(c);
}catch(b){alert("Error while executing filter XHTML - "+b.toString());
}}else{a=$telerik.getOuterHtml(c);
}a=a.replace(/<body\s*\/>/i,"<body></body>").trim();
for(var d=0;
d<this._filters.length;
d++){var e=this._filters[d];
if((!e.get_isDom())&&(false!=e.get_enabled())&&e.getHtmlContent){try{a=e.getHtmlContent(a);
}catch(b){alert("Error while executing filter "+e.get_name()+" - "+b.toString());
}}}return a;
}};
Telerik.Web.UI.Editor.FiltersManager.registerClass("Telerik.Web.UI.Editor.FiltersManager",Sys.Component);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.RestorePoint=function(a){this.Window=a;
this.Document=a.document;
this.update();
this.Update=this.update;
this.Restore=this.restore;
this.Select=this.select;
};
if($telerik.isIE){Telerik.Web.UI.Editor.RestorePoint.prototype={update:function(){this.HtmlText=this.Document.body.innerHTML;
var a=this.Document.selection.createRange();
if(a.length){this.SourceIndex=a.item(0).sourceIndex;
}else{this.oldRange=a;
this.parentElement=a.parentElement();
this.StartBookmark=a.getBookmark();
}},restore:function(a){Telerik.Web.UI.Editor.Utils.setElementInnerHtml(this.Document.body,this.HtmlText);
this.select(a);
},select:function(b){if(null!=this.SourceIndex){try{var a=this.Document.body.createControlRange();
a.addElement(this.Document.all(this.SourceIndex));
a.select();
}catch(c){}}else{if(null!=this.StartBookmark){var a=this.Document.body.createTextRange();
if(this.useOldRange&&this.parentElement&&this.parentElement.tagName=="TD"){a=this.oldRange;
}else{a.moveToBookmark(this.StartBookmark);
}a.select();
if(true==b&&a.collapse){a.collapse();
}}}}};
}else{Telerik.Web.UI.Editor.RestorePoint.prototype={restore:function(){try{this.Window.document.body.innerHTML=this.HtmlText;
this.select();
}catch(a){}},select:function(){try{this.Window.focus();
this._moveToBookmark(this.Window.getSelection(),this.Bookmark);
}catch(a){}},update:function(){try{this.HtmlText=this.Window.document.body.innerHTML;
this.Bookmark=this._bookmarkSelection(this.Window.getSelection());
}catch(a){}},_bookmarkSelection:function(a){if(a){return{anchorNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,a.anchorNode),anchorOffset:a.anchorOffset,focusNodeBookmark:new Telerik.Web.UI.Editor.SelectionBookmark(this.Window,a.focusNode),focusOffset:a.focusOffset,isCollapsed:a.isCollapsed};
}else{return{};
}},_moveToBookmark:function(a,d){var c=d.anchorNodeBookmark.select();
var b=d.focusNodeBookmark.select();
a.collapse(c,d.anchorOffset);
if(!d.isCollapsed){a.extend(b,d.focusOffset);
}}};
}Telerik.Web.UI.Editor.RestorePoint.registerClass("Telerik.Web.UI.Editor.RestorePoint",null);
Telerik.Web.UI.Editor.SelectionBookmark=function(a,b){this.Window=a;
this.NodePath=this._findNodePath(this.Window.document.documentElement,b);
};
Telerik.Web.UI.Editor.SelectionBookmark.prototype={select:function(){var b=this._findNode(this.Window.document.documentElement,this.NodePath);
try{Telerik.Web.UI.Editor.Utils.selectElement(this.Window,b);
}catch(a){}return b;
},_findNodePath:function(b,e){var a,c;
for(var d=0;
d<b.childNodes.length;
d++){a=b.childNodes[d];
c=this._findNodePath(a,e);
if(""!=c){return""+d+","+c;
}if(a==e){return""+d;
}}return"";
},_findNode:function(b,d){var a=d.split(",");
for(var c=0;
c<a.length;
c++){b=b.childNodes[a[c]];
}return b;
}};
Telerik.Web.UI.Editor.SelectionBookmark.registerClass("Telerik.Web.UI.Editor.SelectionBookmark",null);
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Selection=function(a){this._window=a;
this.isSafari=$telerik.isSafari;
this.isOpera=$telerik.isOpera;
this.GetRange=this.getRange;
this.GetParentElement=this.getParentElement;
this.IsControl=this.isControl;
this.GetText=this.getText;
this.GetHtmlText=this.getHtml;
this.PasteHtml=this.pasteHtml;
this.Collapse=this.collapse;
};
Telerik.Web.UI.Editor.Selection.prototype={selectElement:function(a){return Telerik.Web.UI.Editor.Utils.selectElement(this._window,a);
},pasteHtml:function(a,b){b=(b==true);
if($telerik.isIE){return this._executeIE(a,b);
}else{return this._executeMozilla(a,b);
}},_executeIE:function(b,c){var g=this._window.document;
var e=g.selection;
if(e.type.toLowerCase()!="none"){e.createRange().execCommand("Delete");
}if(e.type.toLowerCase()!="none"){g.execCommand("Delete");
}g.body.setActive();
selRange=e.createRange();
if(selRange&&selRange.length){var a=selRange.item(0);
if(a&&a.tagName=="BODY"){var f=a.getElementsByTagName("FORM")[0];
if(f){Telerik.Web.UI.Editor.Utils.setElementInnerHtml(f,f.innerHTML+b);
}}}else{var d=selRange.duplicate();
d.collapse(true);
b=Telerik.Web.UI.Editor.Utils.getStoredOriginalPathsAndAttributes(b);
selRange.pasteHTML(b);
Telerik.Web.UI.Editor.Utils.restoreOriginalPathsAndAttributes(selRange.parentElement());
if(c){d.setEndPoint("EndToEnd",selRange);
d.select();
}}return true;
},_executeMozilla:function(f,g){var b=this._window.document;
var e=b.createElement("SPAN");
e.innerHTML=f;
if(this.isSafari||this.isOpera){var j="radetempnode";
e.setAttribute("id",j);
if(this.isSafari){g=true;
}this._insertNodeAtSelection(this._window,e,g);
var d=b.createRange();
var c=this._window.getSelection();
var i=b.getElementById(j);
d.selectNodeContents(i);
var a=d.extractContents();
d.selectNode(i);
var h=d.extractContents();
d.insertNode(a);
c.addRange(d);
if(this.isSafari){c.collapseToEnd();
}}else{var d=b.createRange();
d.selectNodeContents(e);
var a=d.extractContents();
if(a.childNodes.length==1){a=a.childNodes[0];
}this._insertNodeAtSelection(this._window,a,g);
}return true;
},_insertNodeAtSelection:function(h,r,m){var a=h.getSelection();
if(a.rangeCount==0){h.document.body.appendChild(r);
return;
}var f=null;
if(a.getRangeAt){f=a.getRangeAt(0);
}else{f=h.document.createRange();
f.setStart(a.anchorNode,a.anchorOffset);
f.setEnd(a.focusNode,a.focusOffset);
}if(a.removeAllRanges){a.removeAllRanges();
}f.deleteContents();
var g=$telerik.isSafari2?a.baseNode:f.startContainer;
var v=$telerik.isSafari2?a.baseOffset:f.startOffset;
var q=g.previousSibling;
if($telerik.isSafari&&null==g){g=h.document.body;
}f=h.document.createRange();
if((r.nodeType==3)&&(g.nodeType==3)){g.insertData(v,r.nodeValue);
f.setEnd(g,v+r.length);
if(m){f.setStart(g,v);
}else{f.setStart(g,v+r.length);
}}else{var p;
var o=null;
if(g.nodeType==3){var b=g;
g=b.parentNode;
var c=b.nodeValue;
var d=c.substr(0,v);
var t=c.substr(v);
var s=h.document.createTextNode(d);
var p=h.document.createTextNode(t);
var k=false;
if($telerik.isFirefox&&r.nodeType!=1){var e=r.childNodes;
var n=e.length;
for(var u=0;
u<n;
u++){if(e[u].nodeType!=3){k=true;
break;
}}}g.insertBefore(p,b);
g.insertBefore(r,p);
try{g.insertBefore(s,r);
}catch(j){}g.removeChild(b);
if($telerik.isFirefox&&k){var w=document.createTextNode(d);
if(q){g.insertBefore(w,q.nextSibling);
}else{g.insertBefore(w,g.childNodes[0]);
}}}else{if(g.childNodes.length>0){p=g.childNodes[v];
g.insertBefore(r,p);
}else{g.appendChild(r);
}}if(g.tagName=="BODY"&&!p){var e=g.childNodes;
o=e[e.length-1];
}try{if(m){f.setStart(r,0);
f.setEnd(p,0);
}else{if(o){f.setStartAfter(o);
f.setStartAfter(o);
}else{f.setStartBefore(p);
f.setEndBefore(p);
}}}catch(j){}}try{a.addRange(f);
}catch(j){}},selectRange:function(a){if(!a){return;
}var e=this._window;
if(a.select){a.select();
}else{if(e.getSelection){var c=e.getSelection();
if(c.removeAllRanges){c.removeAllRanges();
c.addRange(a);
}else{var b=a.baseNode;
if(null==b){b=e.document.body;
}var d=a.extentNode;
if(null==d){d=e.document.body;
}c.setBaseAndExtent(b,a.startOffset,d,a.endOffset);
}}}},getBrowserSelection:function(){if(!this._window){return null;
}if(this._window.document.selection&&!window.opera){return this._window.document.selection;
}else{if(this._window.getSelection){return this._window.getSelection();
}}return null;
},getRange:function(){if(!this._window){return null;
}if(this._window.document.selection&&!window.opera){return this._window.document.selection.createRange();
}else{if(this._window.getSelection){var b=this._window.getSelection();
if(!b||b.rangeCount<1){return null;
}var a=null;
if(b.getRangeAt){a=b.getRangeAt(0);
}else{a=this._window.document.createRange();
a.setStart(b.anchorNode,b.anchorOffset);
a.setEnd(b.focusNode,b.focusOffset);
}return a;
}}},getParentElement:function(){var d=this.getRange();
if(!d){return null;
}if(d.commonAncestorContainer){var e=this._window.getSelection();
var a=d.startContainer?d.startContainer:e.baseNode;
var f=d.endContainer?d.endContainer:e.extentNode;
var c=d.startOffset!=null?d.startOffset:e.baseOffset;
var b=d.endOffset!=null?d.endOffset:e.extentOffset;
if(a==f&&(b-c)==1&&e.anchorNode.childNodes[e.anchorOffset]){return e.anchorNode.childNodes[e.anchorOffset];
}else{if($telerik.isSafari){if(e.anchorNode.parentNode.tagName=="TH"||e.anchorNode.parentNode.tagName=="TD"){return e.anchorNode.parentNode;
}else{if(e.anchorNode.parentNode.tagName=="TR"){return e.anchorNode;
}}}if(!d.commonAncestorContainer.tagName){if(this._window.document==d.commonAncestorContainer&&e.baseNode){return e.baseNode.parentNode;
}return d.commonAncestorContainer.parentNode;
}else{return d.commonAncestorContainer;
}}}else{if(d.length){return d.item(0);
}else{if(d.parentElement){return d.parentElement();
}else{return null;
}}}},isControl:function(){if(this._window.document.selection){return(this._window.document.selection.type=="Control");
}else{var b=this._window.getSelection();
if(b.toString()!=""){return false;
}var a=b.focusNode;
if(!a||a.nodeType==1){return false;
}return(a.tagName=="IMG");
}},getText:function(){if(this._window.document.selection){var a=this._window.document.selection.createRange();
if(a.length){return"";
}else{if(null!=a.text){return a.text;
}}}else{if(this._window.getSelection){return this._window.getSelection().toString();
}else{return"";
}}},getHtml:function(){if(this._window.document.selection&&!window.opera){var c=this._window.document.selection.createRange();
if(c.length){return c.item(0).outerHTML;
}else{if(c.htmlText){return c.htmlText;
}else{return"";
}}}else{if(this._window.getSelection){var b=this._window.getSelection();
var c=null;
if(null==b){return"";
}if(b.getRangeAt&&typeof(b.rangeCount)!="undefined"&&b.rangeCount==0){return"";
}if(b.getRangeAt){c=b.getRangeAt(0);
var a=this._window.document.createElement("div");
var d=c.cloneContents();
if(d){a.appendChild(d);
return a.innerHTML;
}else{return"";
}}else{return b;
}}else{return"";
}}},collapse:function(c){c=(c==true);
if(this._window.document.selection){var b=this._window.document.selection.createRange();
if(b.collapse){b.collapse(c);
b.select();
}}else{if(this._window.getSelection){var a=this._window.getSelection();
if(!a.isCollapsed){if(c){a.collapseToStart();
}else{a.collapseToEnd();
}}}}}};
Telerik.Web.UI.Editor.Selection.registerClass("Telerik.Web.UI.Editor.Selection",null);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.EditorShortCutManager=function(){this._shortcuts=[];
};
Telerik.Web.UI.EditorShortCutManager.prototype={addShortCut:function(a,b){var c=new Telerik.Web.UI.EditorShortCut(a,b);
c.HashValue=this._getShortCutHashValue(c);
this._shortcuts[c.HashValue]=c;
},removeShortCut:function(a){var b=this.findShortCutByName(a);
if(b){this._shortcuts[b.HashValue]=null;
}},setShortCut:function(a,b){this.removeShortCut(a);
this.addShortCut(a,b);
},isShortCutHit:function(a){return this._hitTest(a.keyCode,a.ctrlKey,(null!=a.ctrlLeft?a.ctrlLeft:a.ctrlKey),a.shiftKey,(null!=a.shiftLeft?a.shiftLeft:a.shiftKey),a.altKey,(null!=a.altLeft?a.altLeft:a.altKey));
},_hitTest:function(d,e,b,a,f,g,h){var c=this._getHashValue(d,e,b,a,f,g,h);
return this._shortcuts[c];
},_getHashValue:function(e,f,d,a,g,h,i){var c=e&65535;
var b=0;
b|=(f?(1<<0):0);
b|=(a?(1<<2):0);
b|=(h?(1<<4):0);
c|=(b<<16);
return c;
},_getShortCutHashValue:function(a){return this._getHashValue(a.KeyCode,a.CtrlKey,a.LeftCtrlKey,a.ShiftKey,a.LeftShiftKey,a.AltKey,a.LeftAltKey);
},findShortCutByName:function(a){var c;
for(var b in this._shortcuts){c=this._shortcuts[b];
if(null!=c&&c._name==a){return c;
}}return null;
}};
Telerik.Web.UI.EditorShortCut=function(a,b){this._name=a;
this._shortcutString="";
this.setShortCut(b);
};
Telerik.Web.UI.EditorShortCut.prototype={CtrlKey:false,LeftCtrlKey:false,ShiftKey:false,LeftShiftKey:false,AltKey:false,LeftAltKey:false,KeyCode:0,get_name:function(){return this._name;
},set_name:function(a){this._name=a;
},get_shortCutString:function(){return this._shortcutString;
},setShortCut:function(a){this._parseShortcutString(a);
this._shortcutString=a;
},_parseShortcutString:function(a){if("string"==typeof(a)){this.CtrlKey=false;
this.LeftCtrlKey=false;
this.ShiftKey=false;
this.LeftShiftKey=false;
this.AltKey=false;
this.LeftAltKey=false;
this.KeyCode=0;
a=a.replace(/\s*/gi,"");
a=a.replace(/\+\+/gi,"+PLUS");
var b=a.split("+");
var d="";
for(var c=0;
c<b.length;
c++){d=b[c].toUpperCase();
switch(d){case"LCTRL":this.LeftCtrlKey=true;
case"CTRL":this.CtrlKey=true;
break;
case"LSHIFT":this.LeftShiftKey=true;
case"SHIFT":this.ShiftKey=true;
break;
case"LALT":this.LeftAltKey=true;
case"ALT":this.AltKey=true;
break;
case"F1":this.KeyCode=112;
break;
case"F2":this.KeyCode=113;
break;
case"F3":this.KeyCode=114;
break;
case"F4":this.KeyCode=115;
break;
case"F5":this.KeyCode=116;
break;
case"F6":this.KeyCode=117;
break;
case"F7":this.KeyCode=118;
break;
case"F8":this.KeyCode=119;
break;
case"F9":this.KeyCode=120;
break;
case"F10":this.KeyCode=121;
break;
case"F11":this.KeyCode=122;
break;
case"F12":this.KeyCode=123;
break;
case"ENTER":this.KeyCode=13;
break;
case"HOME":this.KeyCode=36;
break;
case"END":this.KeyCode=35;
break;
case"LEFT":this.KeyCode=37;
break;
case"RIGHT":this.KeyCode=39;
break;
case"UP":this.KeyCode=38;
break;
case"DOWN":this.KeyCode=40;
break;
case"PAGEUP":this.KeyCode=33;
break;
case"PAGEDOWN":this.KeyCode=34;
break;
case"SPACE":this.KeyCode=32;
break;
case"TAB":this.KeyCode=9;
break;
case"BACK":this.KeyCode=8;
break;
case"CONTEXT":this.KeyCode=93;
break;
case"ESCAPE":case"ESC":this.KeyCode=27;
break;
case"DELETE":case"DEL":this.KeyCode=46;
break;
case"INSERT":case"INS":this.KeyCode=45;
break;
case"PLUS":this.KeyCode="+".charCodeAt(0);
break;
default:this.KeyCode=d.charCodeAt(0);
break;
}}}else{throw {description:"Invalid shortcut string"};
}}};
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI._localization=function(){this._controls={};
};
Telerik.Web.UI._localization.prototype={merge:function(c,e,b){if(typeof(this._controls[c])=="undefined"){this._controls[c]={};
}if(typeof(this._controls[c][e])=="undefined"){this._controls[c][e]={};
}var a=this._controls[c][e];
for(var d in b){if(typeof(b[d])=="string"){a[d]=b[d];
}}return a;
}};
Telerik.Web.UI._localization.registerClass("Telerik.Web.UI._localization");
Telerik.Web.UI.Localization=new Telerik.Web.UI._localization();
Type.registerNamespace("Telerik.Web.UI");
(function(){var b=$telerik.$;
var a=Telerik.Web.UI;
a.RadEditor=function(c){a.RadEditor.initializeBase(this,[c]);
this._rootElement=null;
this._bottomResizer=null;
this._tableElement=null;
this._document=null;
this._contentArea=null;
this._contentAreaElement=null;
this._contentHiddenTextarea=null;
this._contentWindow=null;
this._doctypeString=null;
this._originalHeight=null;
this._accessKeyTextbox=null;
this._mode=a.EditModes.Design;
this._shortCutManager=new a.EditorShortCutManager();
this._filtersManager=new a.Editor.FiltersManager();
this._commandsManager=new a.Editor.CommandsManager();
if(null!=a.Editor.ModulesManager){this._modulesManager=new a.Editor.ModulesManager(this);
}this._resizeExtender=null;
this._localization={};
this._contentAreaEventHandlers={};
this._onToolClickDelegate=Function.createDelegate(this,this._onToolClick);
this._onWindowResizeDelegate=null;
this._saveContentDelegate=null;
this.isIE=$telerik.isIE;
this.isFirefox=$telerik.isFirefox;
this.isOpera=$telerik.isOpera;
this.isIE7=$telerik.isIE7;
this._spellCheckService=null;
};
a.RadEditor.createNew=function(c){var d=new a.RadEditor(document.createElement("div"));
if(!c){d.get_contentAreaElement();
}else{d._contentAreaElement=c;
}d._contentHiddenTextarea=document.createElement("input");
d._setContentAreaHtml("",true);
d.set_editable(true);
d._ieHookToClientArea();
d._addDefaultShortCuts();
d.removeShortCut("ToggleScreenMode");
d.removeShortCut("LinkManager");
d.removeShortCut("ImageManager");
d.removeShortCut("SetToolFocus");
return d;
};
a.RadEditor.prototype={get_ajaxSpellCheck:function(){return this._ajaxSpellCheck;
},set_ajaxSpellCheck:function(c){this._ajaxSpellCheck=c;
this.raiseEvent("spellCheckLoaded");
},get_spellCheckService:function(){if(!this._spellCheckService){this._spellCheckService=$create(a.SpellCheckService,this.get_spellCheckJSON(),null,null);
this._spellCheckService.add_complete(Function.createDelegate(this,this._responseReceived));
}return this._spellCheckService;
},startSpellCheck:function(){this.get_spellCheckService().spellCheck(this.get_html());
},addCustomWord:function(c){this.get_spellCheckService().addCustomWord(c);
},_responseReceived:function(d,c){},raiseEvent:function(d,c){if(d!="selectionChange"||this.get_mode()==a.EditModes.Design){a.RadEditor.callBaseMethod(this,"raiseEvent",[d,c]);
}},_initializeToolProvider:function(){var j=this;
var l=j.get_toolProviderID();
if(l&&$find(l)){var i=$find(l);
var h=i.get_dialogOpener();
j.set_dialogOpener(h);
var c=i.get_contextMenusJSON();
if(c&&c.concat){j.set_contextMenusJSON(c.concat([]));
}var f=i.get_modulesJSON();
if(f&&f.concat){j.set_modulesJSON(f.concat([]));
}var d=this.get_toolContainer();
d.innerHTML="";
this.set_toolJSON([]);
var g=i.get_toolHTML();
d.innerHTML=g;
var k=i.get_toolJSON().concat([]);
this.set_toolJSON(k);
if(i.get_spellCheckJSON){j.set_spellCheckJSON(i.get_spellCheckJSON());
}if(i.get_ajaxSpellCheckScriptReference){var e=i.get_ajaxSpellCheckScriptReference();
if(e){j.set_ajaxSpellCheckScriptReference(e);
}}}},get_toolHTML:function(){var c=this.get_toolContainer().cloneNode(true);
return c.innerHTML;
},get_toolContainer:function(){return this.get_TopZone().firstChild;
},get_mainTable:function(){return $get(this.get_id()+"Wrapper");
},_ieHookToClientArea:function(){var c=this;
window.setTimeout(function(){if($telerik.isIE){var g=c.get_contentArea();
if(!g){return;
}try{var f=a.Editor.Utils.storeBrowserPosition();
var d=g.createTextRange();
var h=document.body.createTextRange();
if(f&&f.y>0){h.moveToElementText(c.get_contentAreaElement());
}else{h.moveStart("textedit",h.text.length);
}h.collapse(true);
h.select();
if(f&&f.y>0){a.Editor.Utils.restoreBrowserPosition();
}}catch(i){}}},0);
},initialize:function(){a.RadEditor.callBaseMethod(this,"initialize");
this.raiseEvent("init",Sys.EventArgs.Empty);
this._initializeToolProvider();
var e=this.get_mainTable();
this._originalHeight=e.style.height;
this._initializeLocalization();
this._addFilters();
this._addDefaultShortCuts();
this._createUI();
var c=this.isVisible();
if(c){this._fixMoreSizeIssues();
}e=$get(this.get_id()+"_BottomTable");
if(e){e.style.display="";
}this._createTools();
this._makeResizeable(this.get_enableResize());
var d=$get(this.get_id()+"ContentHiddenTextarea");
if(d){d.setAttribute("id",this.get_id());
this._contentHiddenTextarea=d;
}this._setContentAreaHtml(this.get_contentHiddenTextareaValue(),true);
this._registerClientValidation();
this._registerPostBackHandlers();
if(!this._isEditModeEnabled(a.EditModes.Design)){if(this._isEditModeEnabled(a.EditModes.Html)){this.set_mode(a.EditModes.Html);
}else{this.set_mode(a.EditModes.Preview);
}}this._ieHookToClientArea();
this._fixIEVisibilityProblems(true);
this._fixMozillaDOMProblems(true);
if(this._modulesManager){if(!this.isIE){var g=$get(this.get_id()+"Module");
g.style.display="none";
var f=this;
window.setTimeout(function(){f._modulesManager.initialize();
g.style.display="";
if(f.isOpera){f._updateEditorSize(f._originalHeight);
}},0);
}else{this._modulesManager.initialize();
this._updateEditorSize(this._originalHeight);
}}if(this.get_autoResizeHeight()&&c){this._makeAutoResizeHeight();
}this.set_initialContent();
this._applyAccessKey();
this.raiseEvent("load",Sys.EventArgs.Empty);
if(!$telerik.isIE&&!$telerik.isFirefox){if(!this.isVisible()){this.raiseEvent("firstShow");
}}},dispose:function(){if(typeof(Sys.WebForms)!="undefined"&&typeof(Sys.WebForms.PageRequestManager)!="undefined"&&this._saveContentDelegate){var c=Sys.WebForms.PageRequestManager.getInstance();
if(c){c.remove_initializeRequest(this._saveContentDelegate);
}c=null;
}if(this._contentHiddenTextarea&&this._contentHiddenTextarea.form&&this._saveContentDelegate){$telerik.removeExternalHandler(this._contentHiddenTextarea.form,"submit",this._saveContentDelegate);
}if(this._contentAreaElement){$clearHandlers(this._contentAreaElement);
this._contentAreaElement.parentNode.removeChild(this._contentAreaElement);
}this._detachEvents();
this._fixMozillaDOMProblems(false);
this._fixIEVisibilityProblems(false);
this._makeResizeable(false);
this._onToolClickDelegate=null;
this._onWindowResizeDelegate=null;
this.set_dialogOpener(null);
this._saveContentDelegate=null;
this._registerModeChangeHandler(false);
if(this._accessKeyTextbox){$clearHandlers(this._accessKeyTextbox);
this._accessKeyTextbox.removeAttribute("accessKey");
this._accessKeyTextbox=null;
}a.RadEditor.callBaseMethod(this,"dispose");
},_applyAccessKey:function(){var c=this.get_element().getAttribute("accessKey");
if(c){this.get_element().removeAttribute("accessKey");
var e=document.createElement("input");
e.setAttribute("name",this.get_id()+"EditorAccessKey");
e.setAttribute("type","text");
e.setAttribute("id",this.get_id()+"EditorAccessKey");
e.setAttribute("accessKey",c);
this._accessKeyTextbox=e;
$addHandlers(this._accessKeyTextbox,{focus:this.setFocus},this);
var d=document.createElement("div");
d.style.width="0px";
d.style.height="0px";
d.style.overflow="hidden";
d.appendChild(this._accessKeyTextbox);
this.get_element().appendChild(d);
}},_makeAutoResizeHeight:function(){if(this._initialContentHeight&&this._initialContentHeight>0){return;
}window.setTimeout(Function.createDelegate(this,function(){this.get_contentArea().style.overflow="hidden";
this._initialContentHeight=this._contentAreaElement.offsetHeight;
var c=this;
this.attachEventHandler("keydown",function(d){if(!c._isKeyUpButton(d)){c._resizeContentArea(d);
}});
this.attachEventHandler("keyup",function(d){if(c._isKeyUpButton(d)||(d.keyCode==13&&!c.isIE)){c._resizeContentArea(d);
}});
this.add_selectionChange(Function.createDelegate(this,this._resizeContentArea));
this._resizeContentArea();
}),0);
},_isKeyUpButton:function(d){var c=d.keyCode;
if(c==8||c==46){return true;
}return false;
},_getCurrentFontSize:function(){var d=this.getSelectedElement();
var c=parseInt($telerik.getCurrentStyle(d,"fontSize"));
return c;
},_resizeContentArea:function(i){var l=this.isIE?this._document.body:this._document.documentElement;
var g=this._contentAreaElement;
var h=g.parentNode;
var k=this._initialContentHeight;
var d=g.offsetHeight;
var f=l.scrollHeight+(i&&i.keyCode==13&&this.isIE?this._getCurrentFontSize():0);
if(f==d){return;
}if((k==d)&&(f<=k)){return;
}var m=(f>k)?f:k;
g.style.height=m+"px";
if(f>d){h.style.height=parseInt(f)+"px";
}else{var c=this.get_element();
var j=c.offsetHeight-(h.offsetHeight-g.offsetHeight);
if(g.style.height!="100%"){h.style.height="";
this._updateEditorSize(j);
}return;
}this._updateEditorSize(null,true);
},_makeResizeable:function(c){if(this._resizeExtender){this._resizeExtender.dispose();
this._resizeExtender=null;
}if(!c){return;
}if(!this._tableElement){return;
}if(!this._bottomResizer){this._bottomResizer=$get(this.get_id()+"BottomResizer");
}if(this._bottomResizer){if(this.isIE){this._bottomResizer.style.styleFloat="right";
}if(this.isOpera&&document.compatMode=="CSS1Compat"){this._bottomResizer.parentNode.removeChild(this._bottomResizer);
this._bottomResizer=null;
}}else{return;
}var d={se:this._bottomResizer};
this._resizeExtender=new a.ResizeExtender(this,this._rootElement,d,this._tableElement);
},_getInvisibleParent:function(){return a.Editor.Utils.getInvisibleParent(this.get_element());
},isVisible:function(){return(this._getInvisibleParent()==null);
},_fixIEVisibilityProblems:function(c){if(!this.isIE){return;
}if(c){var d=this._getInvisibleParent();
if(d){this._onIEParentVisibilityChangeDelegate=Function.createDelegate(this,this._onIEParentVisibilityChange);
this._invisibleParent=d;
$addHandler(this._invisibleParent,"propertychange",this._onIEParentVisibilityChangeDelegate);
}}else{if(this._invisibleParent&&this._onIEParentVisibilityChangeDelegate){$removeHandler(this._invisibleParent,"propertychange",this._onIEParentVisibilityChangeDelegate);
this._onIEParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}}},_fixMozillaDOMProblems:function(c){if(this.isIE){return;
}if(c){var d=this._getInvisibleParent();
if(d){this._invisibleParent=d;
this._onMozillaParentVisibilityChangeDelegate=Function.createDelegate(this,this._onMozillaParentVisibilityChange);
d.addEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
}this._onMozillaParentNodeChangedDelegate=Function.createDelegate(this,this._onMozillaParentNodeChanged);
document.addEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
}else{if(this._invisibleParent&&this._onMozillaParentVisibilityChangeDelegate){this._invisibleParent.removeEventListener("DOMAttrModified",this._onMozillaParentVisibilityChangeDelegate,false);
this._onMozillaParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}if(this._onMozillaParentNodeChangedDelegate){document.removeEventListener("DOMNodeInserted",this._onMozillaParentNodeChangedDelegate,false);
this._onMozillaParentNodeChangedDelegate=null;
}}},_onIEParentVisibilityChange:function(c){c=c.rawEvent;
if(!c){return;
}if(c.propertyName=="style.display"||c.propertyName=="className"){var d=$telerik.getCurrentStyle(this._invisibleParent,"display");
if(d!="none"){this.raiseEvent("firstShow");
if(this.get_autoResizeHeight()){this._makeAutoResizeHeight();
}this._updateEditorSize(this.get_element().style.height);
this._fixIEVisibilityProblems(false);
}}},_onMozillaParentVisibilityChange:function(d){if(d.attrName=="style"||d.attrName=="class"){var c=d.target;
if((d.currentTarget==d.target)&&"none"!=$telerik.getCurrentStyle(c,"display")){window.setTimeout(Function.createDelegate(this,function(){if(!this._editorFirstVisible){this._editorFirstVisible=true;
this.raiseEvent("firstShow");
}if(this.get_autoResizeHeight()){this._makeAutoResizeHeight();
}this.set_editable(true);
}),0);
}}},_onMozillaParentNodeChanged:function(d){if(!d.target||!this.get_element()){return;
}var c=$telerik.isDescendantOrSelf(d.target,this.get_element());
if(c){this.onParentNodeChanged();
}},onParentNodeChanged:function(){if(!$telerik.isIE){var c=this.get_html();
var d=this.get_contentAreaElement();
this._contentWindow=d.contentWindow;
if(this._textIframe){this._textIframe.parentNode.removeChild(this._textIframe);
this._textIframe=null;
}var e=this.get_mode();
this.set_mode(e);
this._setContentAreaHtml(c,true);
this.set_html(c);
}},onResizeStart:function(){this._resizeSelection=this.getSelection().getRange();
this._fixMoreSizeIssues();
},onResizeEnd:function(){this._updateEditorSize(this.get_element().style.height);
if(!this.isIE){return;
}this.setActive();
if(this._resizeSelection){var c=this._resizeSelection.parentElement();
if(c&&(this.get_document()==c.ownerDocument)){this.getSelection().selectRange(this._resizeSelection);
}this._resizeSelection=null;
}},_initializeLocalization:function(){this._localization=a.Localization.merge("RadEditor",this.get_language(),this._localization);
},getSelectedElement:function(){return this.getSelection().getParentElement();
},getSelection:function(){return new a.Editor.Selection(this.get_contentWindow());
},getSelectionHtml:function(){return this.getSelection().getHtml();
},getEditorSelectionRange:function(){var c=this.getSelection().getRange();
var d=this.getSelectedElement();
if(c!=null&&d!=null&&d.ownerDocument!=this.get_document()){c=null;
}return c;
},selectElement:function(c,d){if(a.Editor.Utils.selectElement(this.get_contentWindow(),c)&&false!=d){this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}},undo:function(c){this._commandsManager.undo(c);
},redo:function(c){this._commandsManager.redo(c);
},executeCommand:function(d,e,c){if(!d.get_window()){d.set_window(this.get_contentWindow());
}if(false!=e&&!this.isOpera){this.setFocus();
}this._commandsManager.execute(d,c);
},executeBrowserCommand:function(c,g,d,f){var e=this._localization[c];
this.executeCommand(new a.Editor.BrowserCommand(e,this._contentWindow,c,d));
this.setActive();
this.setFocus();
if(true==f){this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}},createElement:function(i,c,f,h,g,d){var e=this._document.createElement(i);
if(c){e.style.width=c;
}if(f){e.style.height=f;
}if(null!=h){e.id=h;
}if(null!=g){e.name=g;
}if(null!=d){e.value=d;
}return e;
},createRestorePoint:function(){return new a.Editor.RestorePoint(this._contentWindow);
},getToolState:function(d){if(d=="Undo"){return this.get_commandsManager().isUndoAvailable()?a.Editor.CommandStates.Off:a.Editor.CommandStates.Disabled;
}else{if(d=="Redo"){return this.get_commandsManager().isRedoAvailable()?a.Editor.CommandStates.Off:a.Editor.CommandStates.Disabled;
}else{var c=a.Editor.UpdateCommandsArray[d];
if(c&&c.getState){return c.getState(this._contentWindow);
}}}},getToolValue:function(g){var c=a.Editor.UpdateCommandsArray[g];
if(c&&c.getValue){return c.getValue(this._contentWindow);
}else{if(g=="RealFontSize"){var e=this.getSelectedElement();
if(e){var d=null;
try{d=$telerik.getCurrentStyle(e,"fontSize","");
}catch(f){}if(d){var h=parseFloat(d);
if(h>parseInt(d)){if(d.indexOf("px")>-1){d=parseInt(d)+"px";
}}}return d;
}}}},_addFilters:function(){var f=this.get_filtersManager();
var e=this.get_contentFilters();
var d=a.EditorFilters;
f.clear();
var c=e&d.ConvertToXhtml;
f.set_enableXhtmlFilter(c);
if(c){f.add(new a.Editor.CleanAttributesFilter());
}if(e&d.RemoveScripts){f.add(new a.Editor.StripScriptsFilter());
}if(e&d.EncodeScripts){f.add(new a.Editor.EncodeScriptsFilter());
}if(e&d.FixUlBoldItalic){f.add(new a.Editor.FixUlBoldItalic());
}f.add(new a.Editor.FixNestedLists());
if(e&d.ConvertFontToSpan){f.add(new a.Editor.ConvertFontToSpanFilter());
}if(e&d.OptimizeSpans){f.add(new a.Editor.OptimizeSpans());
}if(e&d.FixEnclosingP){f.add(new a.Editor.FixEnclosingP());
}if($telerik.isIE){f.add(new a.Editor.IEKeepObjectDesignFilter());
f.add(new a.Editor.IEKeepObjectParamsFilter());
f.add(new a.Editor.IEKeepCommentsFilter());
f.add(new a.Editor.IEFixEmptyParagraphs());
if(e&d.IECleanAnchors){f.add(new a.Editor.IECleanAnchorsFilter());
}}if(!$telerik.isIE&&!$telerik.isOpera){if(!$telerik.isSafari){f.add(new a.Editor.MozillaKeepFlash(this.get_mozillaFlashOverlayImage()));
}f.add(new a.Editor.MozillaKeepStylesString());
f.add(new a.Editor.MozillaKeepStylesDom());
if(e&d.MozEmStrong){f.add(new a.Editor.MozEmStrongFilter());
}}f.add(new a.Editor.StripJunkFilter());
if(e&d.MakeUrlsAbsolute){f.add(new a.Editor.MakeUrlsAbsolute());
}f.add(new a.Editor.RemoveExtraBrakes());
if(e&d.IndentHTMLContent){f.add(new a.Editor.IndentHTMLContentFilter());
}},addShortCut:function(c,d){if(this._shortCutManager){this._shortCutManager.addShortCut(c,d);
}},removeShortCut:function(c){if(this._shortCutManager){this._shortCutManager.removeShortCut(c);
}},setShortCut:function(c,d){if(this._shortCutManager){this._shortCutManager.setShortCut(c,d);
}},_addDefaultShortCuts:function(){var c=[["Undo","CTRL+Z"],["Redo","CTRL+Y"],["SelectAll","CTRL+A"],["Copy","CTRL+C"],["Paste","CTRL+V"],["Cut","CTRL+X"],["Bold","CTRL+B"],["Italic","CTRL+I"],["Underline","CTRL+U"],["Copy","CTRL+INS"],["Paste","SHIFT+INS"],["ToggleScreenMode","F11"],["LinkManager","CTRL+K"],["ImageManager","CTRL+G"],["SetToolFocus","F10"]];
for(var d=0;
d<c.length;
d++){this.addShortCut(c[d][0],c[d][1]);
}if(this.isIE){this.addShortCut("InsertTab","TAB");
}if(this.get_newLineBr()&&this.isIE){this.addShortCut("Enter","ENTER");
this.addShortCut("ShiftEnter","SHIFT+ENTER");
this.addShortCut("InsertParagraph","CTRL+ENTER");
}else{if(this.isFirefox&&!this.get_newLineBr()){this.addShortCut("EnterParagraphMozilla","ENTER");
}}},bubbleKeyEventToBrowser:function(){this._shortcutHit=false;
},attachEventHandler:function(e,d){if(e.startsWith("on")){e=e.replace("on","");
}$telerik.addExternalHandler(this._document,e,d);
var f=this._contentAreaEventHandlers;
if(!f[e]){f[e]=[];
}var c=f[e];
c[c.length]=d;
},detachEventHandler:function(d,c){if(d.startsWith("on")){d=d.replace("on","");
}$telerik.removeExternalHandler(this._document,d,c);
},_detachEvents:function(){var j=this._contentAreaEventHandlers;
for(var g in j){var h=j[g];
if(h.length!=null){for(var f=0;
f<h.length;
f++){var d=h[f];
if(typeof(d)=="function"){try{this.detachEventHandler(g,d);
}catch(c){}}}h=[];
}}this._contentAreaEventHandlers={};
this._attachIEBodyHandlers(false);
},get_TopZone:function(){return $get(this.get_id()+"Top");
},_createTools:function(){if(!this.get_toolAdapter()){var d=this.get_toolContainer();
var c=eval(this.get_toolAdapterType());
this.set_toolAdapter($create(c,{editor:this,toolJSON:this.get_toolJSON()},{toolClick:this._onToolClickDelegate},null,d));
if(this.isIE){if(this.get_toolbarMode()==a.EditorToolbarMode.Default){d.style.overflow="";
}this._updateEditorSize();
}}},_onToolClick:function(d,c){this.fire(d.get_name(),c);
},getContextMenuByTagName:function(d){var c=this.get_toolAdapter();
if(c&&c.getContextMenuByTagName){return c.getContextMenuByTagName(d);
}},getToolByName:function(d){var c=this.get_toolAdapter();
if(c){return c.getToolByName(d);
}return null;
},getLocalizedString:function(c,e){if(!c){return e;
}var d=this.get_localization()[c];
if(null==d){d=this.get_localization()[c.toLowerCase()];
}return d;
},setFocus:function(){try{if($telerik.isIE&&this.getSelection().isControl()){return;
}if(this.get_mode()!=a.EditModes.Html){this._contentWindow.focus();
}else{var c=this._getTextArea();
c.focus();
}}catch(d){}},setActive:function(){if($telerik.isIE&&this.getSelection().isControl()){return;
}var c=this.get_contentArea();
if(c&&c.setActive){c.setActive();
}},set_visible:function(d){var c=this.get_element();
if(c){c.style.display=d?"":"none";
}this.set_editable(d);
},enableEditing:function(h,l,i){var g=this.get_toolAdapter();
var j=a.EditingOptions;
var k=function(){};
if(!l){l=a.EditingOptions.All;
}this._editingOptions=l;
this._optionalIgnoredTools=i;
if(l&j.ContextMenus){if(g){g.enableContextMenus(h);
}}if(l&j.EditModes){if(!h){this._originalEditModeRef=this.set_mode;
this.set_mode=k;
}else{if(this._originalEditModeRef){this.set_mode=this._originalEditModeRef;
this._originalEditModeRef=null;
}}}if(l&j.Tools){if(g){if(!h){g.setToolState(null,a.Editor.CommandStates.Disabled);
if(i){var d=[];
for(var c in i){var f=g.getToolByName(c);
if(f){d[d.length]=f;
}}g.setToolState(d);
}this._originalSetToolStateRef=g.setToolState;
g.setToolState=k;
}else{if(this._originalSetToolStateRef){g.setToolState=this._originalSetToolStateRef;
this._originalSetToolStateRef=null;
}}}}if(l&j.Modules){var e=this._modulesManager;
if(e){e.setModulesVisible(h);
}}if(l&j.Typing){if(!h){this._disableTypingDelegate=$telerik.cancelRawEvent;
this.attachEventHandler("keypress",this._disableTypingDelegate);
}else{if(this._disableTypingDelegate){this.detachEventHandler("keypress",this._disableTypingDelegate);
this._disableTypingDelegate=null;
}}}if(l&l.Tab){if(!h){this.removeShortCut("InsertTab");
}else{this.setShortCut("InsertTab","TAB");
}}if(h){if(g){g.setToolState(null,a.Editor.CommandStates.Off);
}this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}},set_editable:function(c){if($telerik.isIE||$telerik.isOpera){var d=this;
window.setTimeout(function(){try{d._document.body.setAttribute("contentEditable",""+c);
d._document.execCommand("2D-Position",false,true);
}catch(e){}},0);
}else{var d=this;
window.setTimeout(function(){try{d._document.designMode=c?"on":"off";
if(c){d._document.execCommand("UseCSS",false,true);
d._document.execCommand("styleWithCSS",false,false);
}}catch(f){}},0);
}},get_editable:function(){if($telerik.isIE||$telerik.isOpera){return this._document.body.contentEditable;
}else{return(this._document.designMode=="on");
}},enableContentArea:function(c){if(this.isIE){this.get_document().body.setAttribute("contentEditable",""+c);
}},showExternalDialog:function(j,k,c,q,p,f,i,n,o,e,d,h){var m=this.getEditorSelectionRange();
var g=this;
var l=function(r,s){window.setTimeout(function(){if(m!=null){try{g.getSelection().selectRange(m);
}catch(u){}}if(p&&s!=null){var t=p(r,s);
if(false==t){return;
}g.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}g.setFocus();
},50);
};
this.get_dialogOpener().openUrl(j,k,c,q,l,f,i,n,o,e,d,h);
},showDialog:function(h,f,c){var d=this.getEditorSelectionRange();
var i=this;
var e=function(j,k){window.setTimeout(function(){if(d!=null&&h!="FindAndReplace"){try{i.getSelection().selectRange(d);
}catch(m){}}if(c&&k!=null){var l=c(j,k);
if(false==l){return;
}i.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}i.setFocus();
},50);
};
this.get_dialogOpener().open(h,f,e);
if(this.isIE){var g=this.get_dialogOpener()._getDialogContainer(h);
if(!g||g._DRAG_ATTACHED){return;
}g._DRAG_ATTACHED=true;
g.add_dragEnd(function(){if(d!=null){try{i.getSelection().selectRange(d);
}catch(j){}}});
}},_getModeButtonsWrapper:function(){return this._getChildElement("ModesWrapper");
},_registerModeChangeHandler:function(c){if(c){this._onModeButtonClickDelegate=Function.createDelegate(this,this._onModeButtonClick);
$addHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
}else{if(this._onModeButtonClickDelegate){$removeHandler(this._getModeButtonsWrapper(),"click",this._onModeButtonClickDelegate);
this._onModeButtonClickDelegate=null;
}}},_onModeButtonClick:function(i){var g=this.get_mode();
var d=a.Editor.Utils.getElementParentByTag(i.target,"LI");
if(d){var h=a.EditModes;
var c=Sys.UI.DomElement;
var f=d.getElementsByTagName("A")[0];
if(c.containsCssClass(f,"reMode_html")){g=h.Html;
}else{if(c.containsCssClass(f,"reMode_design")){g=h.Design;
}else{g=h.Preview;
}}}if(g!=this.get_mode()){this.set_mode(g);
}return $telerik.cancelRawEvent(i);
},_changeModeUI:function(c){var d=Sys.UI.DomElement;
var k=a.EditModes;
var g="reMode_";
switch(c){case k.Html:g+="html";
break;
case k.Design:g+="design";
break;
case k.Preview:g+="preview";
break;
}var j=this._getModeButtonsWrapper();
var f=j.getElementsByTagName("A");
for(var h=0;
h<f.length;
h++){var e=f[h];
d.removeCssClass(e,"reMode_selected");
if(d.containsCssClass(e,g)){d.addCssClass(e,"reMode_selected");
}}},_isEditModeEnabled:function(c){return c&this.get_editModes()?true:false;
},get_mode:function(){return this._mode;
},set_mode:function(c){if(!this.validateMaxHtmlLength()){this.displayMaxHtmlLengthErrorMessage();
return false;
}if(!this.validateMaxTextLength()){this.displayMaxTextLengthErrorMessage();
return false;
}this._setEditableDelegate=Function.createDelegate(this,function(){this.remove_editReady(this._setEditableDelegate);
var j=(this._mode==e.Design);
this.set_editable(j);
this.toggleEnhancedEdit(j);
this._setEditableDelegate=null;
});
this.add_editReady(this._setEditableDelegate);
var d=this._mode;
var e=a.EditModes;
if(d==e.Html||c==e.Html){var h=this.get_html(true);
this._mode=c;
this._showTextArea(this._mode==e.Html);
this.set_html(h);
}else{this._mode=c;
this._showTextArea(this._mode==e.Html);
}this._changeModeUI(c);
if(this._mode!=e.Preview){this.setFocus();
if(this.isFirefox&&(!this._document||!this._document.body)){}else{this.set_editable(true);
}if(this._mode==e.Design){this.toggleEnhancedEdit(true);
}}else{this.set_editable(false);
this.toggleEnhancedEdit(false);
}this.setFocus();
var f=this.get_id();
var g=this.get_mainTable();
var i=g.offsetHeight+"px";
this.raiseEvent("modeChange",Sys.EventArgs.Empty);
this._updateEditorSize(i);
},_getTextIframe:function(){if(!this._textIframe){var e=this.get_contentAreaElement();
if(e){this._textIframe=e.cloneNode(true);
this._textIframe.style.position="absolute";
var g=this._textIframe.style;
g.height="2px";
g.width="2px";
e.parentNode.appendChild(this._textIframe);
var d=this._textIframe.contentWindow.document;
if(!$telerik.isIE6||window.location.protocol!="https:"){d.designMode="off";
}var c=d.open("text/html","replace");
var f="<html style='height:100%;'><head><title>New Document</title></head><body style='overflow:hidden;margin:0px;padding:0px;height:100%'><textarea style='font:normal 11px Tahoma;color: #000080;border:0px;height:100%;width:100%'></textarea></body></html>";
if(typeof(c)=="undefined"){c=d;
}c.write(f);
c.close();
}}return this._textIframe;
},_getTextArea:function(){var c=this._getTextIframe();
if(c&&typeof(c.contentWindow)!="unknown"){return c.contentWindow.document.body.firstChild;
}else{return null;
}},get_textArea:function(){return this._getTextArea();
},_showTextArea:function(e){var d=this._getTextIframe();
var c=this.get_contentAreaElement();
if(e){if($telerik.isSafari){c.style.width="0px";
c.style.height="0px";
}else{c.style.display="none";
}d.style.height="";
d.style.display="";
d.style.position="";
if(this.get_autoResizeHeight()){window.setTimeout(function(){d.style.height=(d.parentNode.offsetHeight-6)+"px";
},0);
}d.style.height="100%";
d.style.width="100%";
}else{if($telerik.isSafari){c.style.width="100%";
c.style.height="100%";
}else{c.style.display="";
}d.style.display="none";
}},_setContentAsText:function(c){var d=this._getTextArea();
if(d){d.value=c;
}},_getContentAsText:function(){var d=this._getTextArea();
if(d&&d.value){var c=d.value;
return c;
}return"";
},set_html:function(c,g,f){var d=a.EditModes;
if(this.get_mode()!=d.Html){var e=new a.Editor.GenericCommand(g?g:"Set HTML",this.get_contentWindow());
this._setContentAreaHtml(c);
this.executeCommand(e,f);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}else{this._setContentAsText(c);
}},get_html:function(l){var k=null;
var e="";
var c=this.get_mode();
var f=a.EditModes;
if(c==f.Html){return this._getContentAsText();
}else{if(this.get_fullPage()){if(this._document){k=this._document.getElementsByTagName("HTML")[0];
k=a.Editor.Utils.cloneNodeWithChildren(k);
var g=this._getAllSheets(k);
for(var j=0;
j<g.length;
j++){var d=g[j];
var h=d.getAttribute("id");
if(h&&h.indexOf("RADEDITORSTYLESHEET")==0){d.parentNode.removeChild(d);
}}if($telerik.isIE||$telerik.isOpera){k.getElementsByTagName("BODY")[0].removeAttribute("contentEditable");
}}}else{if(this.get_contentArea()){if(true==l){k=a.Editor.Utils.cloneNodeWithChildren(this.get_contentArea());
}else{k=this.get_contentArea();
}}}}if(k){if(true==l){e=this.get_filtersManager().getHtmlContent(k);
}else{e=$telerik.getOuterHtml(k);
}}e=this._stripBodyTagFromContent(e);
if(this.get_fullPage()&&this._doctypeString){e=this._doctypeString+"\n"+e;
}return e;
},_stripBodyTagFromContent:function(c){c=c.trim();
var d=c.match(/<body[^>]*>/i);
if(d&&d.index==0){c=c.substring(c.indexOf(">")+1,c.length-7);
c=c.trim();
}return c;
},set_initialContent:function(c){if(c!=null){this._initialContent=c;
}else{this._initialContent=this.get_html(true);
}},get_initialContent:function(){return this._initialContent;
},get_text:function(){var d=a.EditModes;
var c="";
if(this.get_mode()!=d.Html){var e=this.get_contentArea();
if(e){if(e.innerText){c=e.innerText;
}else{if(e.textContent!=null){c=e.textContent;
c=c.replace(/<!--(.|\s)*?-->/gi,"");
}else{c=e.innerHTML.replace(/<\/?[^>]*>/ig,"");
c=c.replace(/&nbsp;/gi,"");
}}}}else{c=this._getTextArea().value.replace(/<\/?[^>]*>/ig,"");
}return c;
},_getUniqueStyleSheetId:function(c){return"RADEDITORSTYLESHEET"+c;
},_getAllSheets:function(f){if(!f){alert("RadEditor._getAllSheets called with no document object provided");
}var g=f.getElementsByTagName("link");
var e=f.getElementsByTagName("style");
var c=[];
var d;
for(d=0;
g[d];
d++){var h=g[d].rel?g[d].rel:g[d].getAttribute("rel");
if(typeof(h)=="string"&&h.toLowerCase().indexOf("style")+1){Array.add(c,g[d]);
}}for(d=0;
e[d];
d++){Array.add(c,e[d]);
}return c;
},_getClassName:function(f){var e=f&&f.selectorText?f.selectorText:"";
var d=e.lastIndexOf(".");
if(d==-1){return"";
}var c=e.indexOf(" ",d);
if(-1==c){c=e.indexOf(":",d);
}if(-1==c){c=e.length;
}return e.substring((d+1),c);
},_createCssFilterObject:function(){if(this._cssClassesHash){return;
}var c=this.get_cssClasses();
if(c&&c.length>0){var h={};
var g=c.length;
for(var f=0;
f<g;
f++){var e=c[f][0];
var d=c[f][1];
h[e.replace(/(.*?)\./ig,function(i){return i.toUpperCase();
})]=d;
}this._cssClassesHash=h;
}},_getFilteredCssClasses:function(d){this._createCssFilterObject();
if(d&&this._cssClassesHash){var e=[];
var f=d.length;
for(var c=0;
c<f;
c++){var g=d[c];
if(outAlias=this._checkCssFilter(g[1].selectorText)){g[2]=outAlias;
e[e.length]=g;
}}return e;
}else{return d;
}},_checkCssFilter:function(c){if(!c||!this._cssClassesHash){return null;
}return this._cssClassesHash[c.replace(/(.*?)\./ig,function(d){return d.toUpperCase();
})];
},getCssArray:function(h){var d=this.get_document();
var c=[];
for(var f=0;
f<d.styleSheets.length;
f++){var j=d.styleSheets[f];
try{this._getStyleSheetRules(c,j,h);
}catch(g){}}c=this._getFilteredCssClasses(c);
return c;
},_getStyleSheetRules:function(h,l,f){var c=l.href;
if(c&&c.indexOf("WebResource.axd?")>-1){return;
}if(c&&c.indexOf(this.get_contentAreaCssFile())>-1){return;
}var g=(l.rules)?l.rules:l.cssRules;
if($telerik.isIE&&l.imports){for(var d=0;
d<l.imports.length;
d++){this._getStyleSheetRules(h,l.imports[d],f);
}}for(var n=0;
n<g.length;
n++){var o=g[n];
if(o&&o.cssText){var p=o.cssText.toLowerCase();
if(p.indexOf("@import")>=0&&o.parentStyleSheet&&o.styleSheet&&o.parentStyleSheet!=o.styleSheet){this._getStyleSheetRules(h,o.styleSheet,f);
continue;
}}var i=o&&o.selectorText?o.selectorText:"";
var e=i.lastIndexOf(".");
if(e<0){continue;
}e=i.lastIndexOf(":");
if(e>0){continue;
}var m=this._getClassName(o);
h[h.length]=[m,o];
}},copyStyleSheets:function(c,d){if(null==c&&null==d){return;
}var u=0;
var q=null;
if(d.styleSheets.length==0){if(d.createStyleSheet){d.createStyleSheet();
}else{css=d.createElement("style");
css.media="all";
css.type="text/css";
var g=d.getElementsByTagName("head")[0];
g.appendChild(css);
q=css;
}}if(d.styleSheets[0]){q=d.styleSheets[0];
}for(var h=0;
h<c.styleSheets.length;
h++){try{var o=c.styleSheets[h];
var e=o.href;
var t=false;
if($telerik.isFirefox){if(o.ownerNode&&o.ownerNode.tagName.toLowerCase()=="style"){t=true;
}}if(e&&!t){continue;
}if(o.media){var r=o.media;
if(r.mediaText!=null){r=r.mediaText;
}if(r&&r!="all"&&r!="screen"){continue;
}}var m=(o.rules)?o.rules:o.cssRules;
for(var k=0;
k<m.length;
k++){var l=m[k];
if(q.addRule){var f=l.selectorText;
var p=l.style.cssText;
if(p&&f){q.addRule(f,p,u);
}}else{if(q.insertRule){q.insertRule(l.cssText,u);
}else{var p=l.selectorText+"{"+l.style.cssText+"}";
var s=d.createTextNode(p);
q.appendChild(s);
}}u++;
}}catch(n){}}},_contentFrameLoadFunction:function(){this._execLoadFunctionSecondTime=false;
try{this._document=this._contentAreaElement.contentWindow.document;
this._contentWindow=this._contentAreaElement.contentWindow;
this._contentArea=this._document.body;
this.get_filtersManager().getDesignContentDom(this.get_contentArea());
var l=0;
a.Editor.Utils.addStyleSheet(this.get_contentAreaCssFile(),this._document,this._getUniqueStyleSheetId(l++));
var g=this.get_tableLayoutCssFile();
if(g){a.Editor.Utils.addStyleSheet(g,this._document,this._getUniqueStyleSheetId(l++));
}var k=this.get_cssFiles();
if(k.length>0){for(var c=0;
c<k.length;
c++){var f=this._getUniqueStyleSheetId(l++);
a.Editor.Utils.addStyleSheet(k[c],this._document,f);
}}else{if(!this.get_fullPage()){this.copyStyleSheets(document,this._document);
var j=this._getAllSheets(document);
for(var c=0;
c<j.length;
c++){var f=this._getUniqueStyleSheetId(l++);
var m=j[c];
if(m.tagName=="LINK"){var d=m.href;
if(!d||d.indexOf("WebResource.axd?")>-1){continue;
}if(m.rel&&m.rel.toLowerCase()!="stylesheet"){continue;
}if(m.media&&m.media!="all"&&m.media!="screen"){continue;
}a.Editor.Utils.addStyleSheet(m.getAttribute("href"),this._document,f);
}else{if(m.tagName=="STYLE"){}}}}}var n=a.Editor.PopupController;
if(n){n.detachFromDocument(this._document);
n.attachToDocument(this._document);
}this._initEvents();
if(this.isVisible()){this.raiseEvent("firstShow");
}if(this.get_mode()!=a.EditModes.Preview){this.set_editable(true);
}else{this.set_editable(false);
}this.toggleEnhancedEdit(true);
if(this._document&&this._document.body){this.raiseEvent("editReady",Sys.EventArgs.Empty);
}}catch(h){}},_extractDoctype:function(d){var e=new RegExp("(<!DOCTYPE[^>]+>)","g");
var c=d.match(e);
return c?c[0]:"";
},_setContentAreaHtml:function(i,f){var g=this.get_filtersManager().getDesignContent(i);
var d=null;
if(-1!=g.toLowerCase().indexOf("<html")){this.set_fullPage(true);
d=g;
this._doctypeString=this._extractDoctype(d);
}else{this.set_fullPage(false);
}if(null!=d||true==f){var k="";
if(this.isOpera){k=" style='height:100%'";
}if(!d){d="<head><style></style></head><body"+k+">"+g+"</body>";
}if($telerik.isFirefox){var j=Function.createDelegate(this,function(){if(this._execLoadFunctionSecondTime){this._contentFrameLoadFunction();
}});
$addHandler(this._contentAreaElement,"load",j);
}try{var c=this._contentAreaElement.contentWindow.document;
c.open();
c.write(d);
c.close();
this._execLoadFunctionSecondTime=false;
if(c.body){this._contentFrameLoadFunction();
}else{this._execLoadFunctionSecondTime=true;
}}catch(h){}}else{a.Editor.Utils.setElementInnerHtml(this._contentArea,g);
this.get_filtersManager().getDesignContentDom(this.get_contentArea());
}},_createUI:function(){if(this._created){return;
}this._registerModeChangeHandler(true);
var e=this.get_id();
this._rootElement=$get(e);
this._tableElement=this.get_mainTable();
var d=$get(e+"Center");
var c=this.get_contentAreaElement();
d.appendChild(c);
this._created=true;
},_updateEditorSize:function(f,c){var e=this._tableElement;
var d=f?f:e.style.height;
if(true==c){d=e.offsetHeight+"px";
}if(parseInt(d)==0){return;
}d=parseInt(d)+"px";
e.style.height=d;
if(this.isIE){this._fixIeHeight(e,d);
}this._fixMoreSizeIssues();
this.get_element().style.height=d;
},_fixIeHeight:function(c,d){if("CSS1Compat"==document.compatMode){var f=(c.offsetHeight-parseInt(d));
if(f>0){var e=(parseInt(c.style.height)-f);
if(e>0){c.style.height=e+"px";
}}}},_fixMoreSizeIssues:function(){if(this.get_autoResizeHeight()){return;
}var g=this._tableElement;
if(g.offsetWidth==0){return;
}var c=this.get_element();
var e=$get(this.get_id()+"Center");
var d=this.get_contentAreaElement();
if(e.style.height!="100%"){e.style.height="100%";
}if(this._isFullScreen){c.style.minHeight="";
c.style.minWidth="";
if($telerik.isOpera){d.style.height="0px";
var f=e.offsetHeight;
d.style.height=f+"px";
e.style.height=f+"px";
}}else{if(!$telerik.isIE){d.style.position="absolute";
var f=e.offsetHeight;
d.style.position="";
if(f<160&&e.offsetHeight>f+2){e.style.height=(f-6)+"px";
}}if($telerik.isOpera){d.style.height="100%";
if(e.style.height=="100%"){e.style.height=(2*e.offsetHeight-e.parentNode.parentNode.offsetHeight-13)+"px";
}}c.style.minHeight=g.style.height;
c.style.minWidth=g.offsetWidth+"px";
if(c.style.width.indexOf("%")<0){c.style.width=c.style.minWidth;
}}},setSize:function(g,h){var f=parseInt(g);
var d=parseInt(h);
var i=this;
var c=this.get_mainTable();
c.style.height="";
var e=c.parentNode;
e.style.width=f+"px";
e.style.height=d+"px";
i._fixIeHeight(e,d);
if(i.isIE){c.style.height=d+"px";
i._fixIeHeight(c,d);
}else{c.style.height="100%";
}},pasteHtml:function(f,g,c,i,o){if(!this.get_editable()){return;
}var l=new a.EditorCommandEventArgs(g,null,f);
if(false==this._executeCommandEvent("pasteHtml",g,l)){return;
}if(f!=l.get_value()){f=l.get_value();
}var j=this.getLocalizedString(g);
var h=this.get_mode();
if(a.EditModes.Design==h){this.setFocus();
this.executeCommand(new a.Editor.PasteHtmlCommand(j,this._contentWindow,f,c),null,o);
if(i!=false){this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}}else{if(a.EditModes.Html==h){var m=this._getTextArea();
if(this.isIE){m.setActive();
var e=document.selection.createRange();
e.text=f;
}else{if(m.setSelectionRange){var p=m.selectionStart;
var d=m.selectionEnd;
var n=m.value.substring(p,d);
var k=f;
m.value=m.value.substring(0,p)+k+m.value.substring(d);
m.setSelectionRange(p+k.length,p+k.length);
this.setFocus();
}}}}},fire:function(c,d){if(c!="Copy"){this._saveTypedContent(true,"editor.fire Copy executing");
}if(false==this._executeCommandEvent("commandExecuting",c,d)){return;
}if(this._optionalIgnoredTools&&!this._optionalIgnoredTools[c]){return;
}this.setActive();
this._pendingTextTypeCmd=null;
var f=a.Editor.CommandList[c];
var h=false;
if(f){h=(false!=f(c,this,d));
}else{alert("The command "+c+" is not implemented yet.");
}if(h){if(!$telerik.isOpera){this.setFocus();
}this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}this._executeCommandEvent("commandExecuted",c,d);
try{if(c=="Undo"&&!$telerik.isIE&&this._document.body.innerHTML.toLowerCase().trim()=="<br>"){this._document.body.innerHTML="<br>";
}}catch(g){}},_executeCommandEvent:function(e,c,d){if(!d){d=new a.EditorCommandEventArgs(c);
}this.raiseEvent(e,d);
if(d.get_cancel&&d.get_cancel()){return false;
}return true;
},_onWindowResize:function(){var c=this._getViewportBounds();
this.setSize(c.width,c.height,false);
},_registerWindowResizeHandler:function(c){if(c){this._onWindowResizeDelegate=Function.createDelegate(this,this._onWindowResize);
$addHandler(window,"resize",this._onWindowResizeDelegate);
}else{if(this._onWindowResizeDelegate){$removeHandler(window,"resize",this._onWindowResizeDelegate);
this._onWindowResizeDelegate=null;
}}},_getViewportBounds:function(){var c=$telerik.getClientBounds();
var d=document.documentElement.scrollLeft||document.body.scrollLeft;
var e=document.documentElement.scrollTop||document.body.scrollTop;
c.scrollLeft=d;
c.scrollTop=e;
return c;
},_handleParentsWithOverflow:function(f){if(false==f){if(!this._parentsWithOverflow){return;
}var j=this._parentsWithOverflow;
var c=j.length;
for(var h=0;
h<c;
h++){var e=j[h];
if(e[0]){var d=e[0].style;
d.overflow=e[1];
d.height=e[2];
d.tableLayout=e[3];
d.position=e[4];
}}this._parentsWithOverflow=null;
}else{this._parentsWithOverflow=[];
var j=this._parentsWithOverflow;
var g=this.get_element().parentNode;
while(g&&g.tagName!="BODY"){var d=g.style;
j[j.length]=[g,d.overflow,d.height,d.tableLayout,d.position];
d.position="static";
d.tableLayout="auto";
d.overflow="visible";
d.height="auto";
g=g.parentNode;
}}},isFullScreen:function(){return this._isFullScreen;
},toggleScreenMode:function(){var i=this;
var f=i.get_element();
if(!i._isFullScreen){i._preFullScreenBodyStyle=[document.body.scroll,document.body.style.margin,""];
document.body.scroll="no";
document.body.style.margin="0px";
if(document.documentElement){i._preFullScreenBodyStyle[2]=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
}i._preFullScreenBounds={width:f.style.width,height:f.style.height};
i._handleParentsWithOverflow(true);
i._onWindowResize();
i._preFullScreenBrowserRect=i._getViewportBounds();
var g=$telerik.getLocation(f);
a.Editor.Utils.restoreBrowserPosition(g.x,g.y);
i._isFullScreen=true;
i._registerWindowResizeHandler(true);
}else{i._registerWindowResizeHandler(false);
document.body.scroll=i._preFullScreenBodyStyle[0];
try{document.body.style.margin=i._preFullScreenBodyStyle[1];
}catch(h){}document.documentElement.style.overflow=i._preFullScreenBodyStyle[2];
i._isFullScreen=false;
i._handleParentsWithOverflow(false);
var d=i._preFullScreenBounds;
i.setSize(d.width,d.height,false);
f.style.width=d.width;
f.style.height=d.height;
var g=i._preFullScreenBrowserRect;
a.Editor.Utils.restoreBrowserPosition(g.scrollLeft,g.scrollTop);
}i._updateEditorSize(f.style.height);
i.set_editable(true);
i.setFocus();
var c=i.getToolByName("ToggleScreenMode");
if(c){c.setOn(i._isFullScreen);
}this.raiseEvent("toggleScreenMode",Sys.EventArgs.Empty);
},validateMaxTextLength:function(d){var c=this.get_maxTextLength();
if(c>0){if(!d){d="";
}return c>this.get_text().length+d.length;
}return true;
},validateMaxHtmlLength:function(c){var d=this.get_maxHtmlLength();
if(d>0){if(!c){c="";
}return d>this.get_html(true).length+c.length;
}return true;
},displayMaxHtmlLengthErrorMessage:function(){alert(this.get_localization()["exceededhtmllength"]+" "+this.get_maxHtmlLength()+". "+this.get_localization()["reducetheconentlength"]+".");
},displayMaxTextLengthErrorMessage:function(){alert(this.get_localization()["exceededtextlength"]+" "+this.get_maxTextLength()+". "+this.get_localization()["reducetheconentlength"]+".");
},get_contentHiddenTextareaValue:function(){if(this._contentHiddenTextarea){return a.Editor.Utils.decodePostbackContent(this._contentHiddenTextarea.value);
}else{return"";
}},set_contentHiddenTextareaValue:function(c){this._contentHiddenTextarea.value=a.Editor.Utils.encodePostbackContent(c);
},get_localization:function(){return this._localization;
},get_contentAreaElement:function(){if(!this._contentAreaElement){var c=document.createElement("iframe");
c.frameBorder="0";
c.src="javascript:'<html></html>';";
c.style.width="100%";
c.style.height="100%";
c.style.margin="0px";
c.style.padding="0px";
c.setAttribute("id",this.get_id()+"_contentIframe");
this._contentAreaElement=c;
}return this._contentAreaElement;
},get_contentArea:function(){return this._contentArea;
},get_document:function(){return this._document;
},get_contentWindow:function(){return this._contentWindow;
},get_shortCutManager:function(){return this._shortCutManager;
},get_filtersManager:function(){return this._filtersManager;
},get_commandsManager:function(){return this._commandsManager;
},get_modulesManager:function(){return this._modulesManager;
},get_language:function(){if(null==this._language){return"en-us";
}return this._language.toLowerCase();
},set_language:function(c){this._language=c;
},get_useClassicDialogs:function(){return this.get_dialogOpener().get_useClassicDialogs();
},set_useClassicDialogs:function(c){this.get_dialogOpener().set_useClassicDialogs(c);
},get_qualifiedSkin:function(){var c=this.get_skin();
return"RadEditor."+c;
},_updateHiddenTextarea:function(){var g=this.get_html(true);
if(this.get_mode()==a.EditModes.Html&&this.get_contentFilters()!=a.EditorFilters.None){if(!this._textSubmitFrame){var e=this.get_contentAreaElement();
if(e){this._textSubmitFrame=e.cloneNode(true);
this._textSubmitFrame.style.position="absolute";
var j=this._textSubmitFrame.style;
j.height="0px";
j.width="0px";
e.parentNode.appendChild(this._textSubmitFrame);
}}if(this._textSubmitFrame){var l=this._textSubmitFrame.contentWindow.document;
var k=this.get_filtersManager().getDesignContent(g);
var i=-1!=k.toLowerCase().indexOf("<html");
var c=i?this._extractDoctype(k):"";
if(!$telerik.isIE6||window.location.protocol!="https:"){l.designMode="off";
}var d=l.open("text/html","replace");
var h=i?k:"<html><head><title>New Document</title></head><body>"+k+"</body></html>";
if(typeof(d)=="undefined"){d=l;
}d.write(h);
d.close();
if(d.body){this.get_filtersManager().getDesignContentDom(d.body);
var f=i?d.getElementsByTagName("HTML")[0]:d.body;
g=c+this.get_filtersManager().getHtmlContent(f);
g=this._stripBodyTagFromContent(g);
}}}this.set_contentHiddenTextareaValue(g);
return g;
},_registerClientValidation:function(){if(typeof(Page_ClientValidate)=="function"){var c=Page_ClientValidate;
Page_ClientValidate=Function.createDelegate(this,function(e){var f=this.get_element();
if(f){var d=this._updateHiddenTextarea();
f.value=d;
f.setAttribute("value",d);
}f=null;
return c(e);
});
}},saveContent:function(d,c){if(this._saveContentDelegate){var f=null;
if(!this.validateMaxHtmlLength()){f=1;
}else{if(!this.validateMaxTextLength()){f=2;
}}if(f){if(c){c.set_cancel(true);
}else{if(f==1){this.displayMaxHtmlLengthErrorMessage();
}else{if(f==2){this.displayMaxTextLengthErrorMessage();
}}}return $telerik.cancelRawEvent(d);
}else{this.raiseEvent("submit",Sys.EventArgs.Empty);
this._updateHiddenTextarea();
}}},_registerPostBackHandlers:function(){this._saveContentDelegate=Function.createDelegate(this,this.saveContent);
var f=this._contentHiddenTextarea.form;
if(f){$telerik.addExternalHandler(f,"submit",this._saveContentDelegate);
}if(typeof(__doPostBack)!="undefined"){var e=this._saveContentDelegate;
var d=__doPostBack;
__doPostBack=function(g,h){e();
d(g,h);
};
}if(typeof(Sys.WebForms)!="undefined"&&typeof(Sys.WebForms.PageRequestManager)!="undefined"){var c=Sys.WebForms.PageRequestManager.getInstance();
if(c){c.add_initializeRequest(this._saveContentDelegate);
}c=null;
}f=null;
},toggleEnhancedEdit:function(e){if(!this.get_document()){return false;
}var c=this.get_document().getElementById(this._getUniqueStyleSheetId(0));
if(c){if(e==null){e=c.disabled;
}c.disabled=!e;
var d=this.getToolByName("ToggleTableBorder");
if(d){d.setOn(e);
}return e;
}else{return false;
}},pasteHyperLink:function(e,d){var f=this.getSelection().getParentElement();
if($telerik.isFirefox&&f.tagName=="A"){f.parentNode.removeChild(f);
}else{this.fire("Unlink");
}var c=a.Editor.Utils.getOuterHtml(e);
this.pasteHtml(c,d);
},_saveTypedContent:function(c,d){if(this._pendingTextTypeCmd){this._pendingTextTypeCmd.update();
}if(true!=c){this._pendingTextTypeCmd=null;
}},_attachIEBodyHandlers:function(d){var c=null;
if(this._document&&this._document.body){c=this._document.body;
}if(!c){return;
}if(d){this._onResizeStartDelegate=Function.createDelegate(this,this._onResizeStart);
this._onResizeEndDelegate=Function.createDelegate(this,this._onResizeEnd);
this._onDropDelegate=Function.createDelegate(this,this._onDrop);
$telerik.addExternalHandler(c,"resizestart",this._onResizeStartDelegate);
$telerik.addExternalHandler(c,"resizeend",this._onResizeEndDelegate);
$telerik.addExternalHandler(c,"drop",this._onDropDelegate);
if($telerik.isIE){this._onDragEndDelegate=Function.createDelegate(this,this._onDragEnd);
this._onDragStartDelegate=Function.createDelegate(this,this._onDragStart);
$telerik.addExternalHandler(c,"dragend",this._onDragEndDelegate);
$telerik.addExternalHandler(c,"dragstart",this._onDragStartDelegate);
}this._onPasteDelegate=Function.createDelegate(this,this._onPaste);
this._onBeforePasteDelegate=Function.createDelegate(this,this._onBeforePaste);
if(!this.isIE7){if(!$telerik.isFirefox){$telerik.addExternalHandler(c,"paste",this._onPasteDelegate);
}else{$telerik.addExternalHandler(c,"paste",this._onBeforePasteDelegate);
}}else{$telerik.addExternalHandler(c,"beforepaste",this._onBeforePasteDelegate);
}}else{if(this._onResizeStartDelegate){$telerik.removeExternalHandler(c,"resizestart",this._onResizeStartDelegate);
}if(this._onResizeEndDelegate){$telerik.removeExternalHandler(c,"resizeend",this._onResizeEndDelegate);
}if(this._onDropDelegate){$telerik.removeExternalHandler(c,"drop",this._onDropDelegate);
}if(this._onDragEndDelegate){$telerik.removeExternalHandler(c,"dragend",this._onDragEndDelegate);
}if(this._onDragStartDelegate){$telerik.removeExternalHandler(c,"dragstart",this._onDragStartDelegate);
}if(!this.isIE7){if(!$telerik.isFirefox){if(this._onPasteDelegate){$telerik.removeExternalHandler(c,"paste",this._onPasteDelegate);
}}else{if(this._onBeforePasteDelegate){$telerik.removeExternalHandler(c,"paste",this._onBeforePasteDelegate);
}}if(this._onPasteDelegate){$telerik.removeExternalHandler(c,"paste",this._onPasteDelegate);
}}else{if(this._onBeforePasteDelegate){$telerik.removeExternalHandler(c,"beforepaste",this._onBeforePasteDelegate);
}}this._onResizeStartDelegate=null;
this._onResizeEndDelegate=null;
this._onDropDelegate=null;
this._onDragEndDelegate=null;
this._onDragStartDelegate=null;
this._onPasteDelegate=null;
this._onBeforePasteDelegate=null;
}},_initEvents:function(){var d=this;
if(!this.isIE){this.attachEventHandler("keypress",function(f){if(d._onKeyPressed(f)){f.preventDefault();
return false;
}});
this.attachEventHandler("click",function(f){if(!d.isFirefox){return;
}if(!d.get_editable()){return;
}if("on"==d._document.designMode){window.setTimeout(function(){d.set_editable(true);
d.setFocus();
},100);
}});
}this.attachEventHandler("keydown",function(g){if(d.isOpera){return d._onKeyDown(g);
}else{d._onKeyDown(g);
}if($telerik.isSafari){var h=d._shortCutManager.isShortCutHit(g);
if(null!=h){var f=h.get_name();
switch(f){case"Bold":case"Italic":case"Underline":$telerik.cancelRawEvent(g);
break;
}}}});
this.attachEventHandler("onmousedown",function(){d._saveTypedContent(false,"Saving typed content onmousedown");
});
this.attachEventHandler("keyup",Function.createDelegate(this,this._onKeyUp));
var c=Function.createDelegate(this,function(f){this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
});
this.attachEventHandler("mouseup",c);
$telerik.addExternalHandler(document.body,"dragend",Function.createDelegate(this,this._onDocumentDragEnd));
this._attachIEBodyHandlers(true);
},_onKeyDown:function(l){var k=l.keyCode;
switch(k){case 46:if($telerik.isOpera){this._document.execCommand("Delete");
this.get_contentArea().contentEditable=true;
this._document.designMode="on";
this.get_contentArea().focus();
return $telerik.cancelRawEvent(l);
}case 8:this._shortcutHit=false;
if(this.getSelectionHtml()){this._saveTypedContent(false,"Saving typed content before allowing delete to proceed..");
this._pendingTextTypeCmd=new a.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this._hasDeleteExecuted=true;
}if(this.isIE){var m=this;
var d=function(){var e=m.getSelectedElement();
if(e&&e.tagName=="EMBED"){e.setAttribute("hidden","true");
e.setAttribute("id","FileToDelete");
window.setTimeout(function(){var q=m._document.getElementById("FileToDelete");
if(q.parentNode&&q.parentNode.removeChild){q.parentNode.removeChild(q);
}},100);
$telerik.cancelRawEvent(l);
return true;
}};
var n=d();
if(n){return false;
}try{var f=m._document.selection.createRange();
var c=null;
if(f&&f.duplicate){c=f.duplicate();
}if(8==l.keyCode){f.moveStart("character",-1);
}else{f.moveEnd("character",1);
}if(f.parentElement().tagName=="EMBED"){f.select();
d();
if(c&&c.select){c.select();
}}}catch(h){}var i=new a.Editor.Selection(this._contentWindow);
if(i&&i.isControl()){var g=i.getRange();
g.execCommand("Delete");
$telerik.cancelRawEvent(l);
}}return;
}var p=l.target?l.target:l.srcElement;
if(p&&"INPUT"!=p.tagName){var j=this._shortCutManager.isShortCutHit(l);
if(null!=j&&j.get_name()=="Copy"){this._shortcutHit=false;
return;
}this._shortcutHit=(null!=j);
if(this._shortcutHit){this.fire(j.get_name());
}else{if(a.Editor.Utils.isCursorMovingKey(l.keyCode)){if(!this._hasCursorMoved){this._saveTypedContent(false,"Saving typed content before letting the cursor move");
}this._hasCursorMoved=true;
return;
}if(32==l.keyCode||13==l.keyCode||!a.Editor.Utils.isSystemKey(l.keyCode)){if(this._hasCursorMoved){this._pendingTextTypeCmd=new a.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this.executeCommand(this._pendingTextTypeCmd);
this._hasCursorMoved=false;
return;
}if(!this._pendingTextTypeCmd){this._pendingTextTypeCmd=new a.Editor.TextTypeCommand(this.getLocalizedString("Typing"),this._contentWindow);
this.executeCommand(this._pendingTextTypeCmd);
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}}}if(this._shortcutHit){if($telerik.isIE||$telerik.isSafari){var o=j.get_name();
if(o=="Cut"||o=="Paste"){return;
}$telerik.cancelRawEvent(l);
}}}},_onKeyUp:function(c){if(this._hasDeleteExecuted){if(this._pendingTextTypeCmd){this.executeCommand(this._pendingTextTypeCmd);
}this._pendingTextTypeCmd=null;
this._hasDeleteExecuted=false;
return;
}if(this._pendingTextTypeCmd){return;
}if(this._pendingCutPasteCommand){this.executeCommand(this._pendingCutPasteCommand);
this._pendingCutPasteCommand=null;
}if(this._shortcutHit){return false;
}this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
},_onKeyPressed:function(c){if(this._pendingTextTypeCmd){}else{this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}if(this._shortcutHit&&!this._pendingCutPasteCommand){return true;
}},_onPaste:function(e){if(this.get_stripFormattingOptions()==a.StripFormattingOptions.NoneSupressCleanMessage){return;
}var c=this.getSelection().getRange();
var d=a.Editor.Utils.getClipboardAsHtml();
var f=(this.get_contentFilters()&a.EditorFilters.RemoveScripts)>0;
var g=a.Editor.Utils.cleanPastedContent(d,this.get_stripFormattingOptions(),this.get_localization()["askwordcleaning"],f);
if(g){var h=this;
window.setTimeout(function(){h.getSelection().selectRange(c);
h.pasteHtml(g,"Paste");
},5);
return $telerik.cancelRawEvent(e);
}return true;
},_onBeforePaste:function(g){if(g){if(this.get_stripFormattingOptions()==a.StripFormattingOptions.NoneSupressCleanMessage){return;
}var i=new a.Editor.GenericCommand("Paste",this._contentWindow);
var c=this.getSelection().getRange();
var j=this.createRestorePoint();
var f=a.Editor.Utils.getPasteContainer();
f.innerHTML="";
if(f.setActive){f.setActive();
}else{var d=this.getSelection();
var h=d.getRange();
if(h.selectNodeContents){h.selectNodeContents(f);
}d.selectRange(h);
}var e=this;
window.setTimeout(function(){var k=f.innerHTML;
var m=(e.get_contentFilters()&a.EditorFilters.RemoveScripts)>0;
var l=a.Editor.Utils.cleanPastedContent(k,e.get_stripFormattingOptions(),e.get_localization()["askwordcleaning"],m);
e._pendingCutPasteCommand=null;
if($telerik.isIE){e.getSelection().selectRange(c);
}else{if(j){j.select();
}}if(l){e.pasteHtml(l,"Paste");
e.executeCommand(i);
}},0);
}},_onResizeStart:function(f){var d=this.getSelectedElement();
if(d==f.srcElement){var c=this.get_localization()["ResizeCommand"]||"Resize";
this._pendingResizeCmd=new a.Editor.GenericCommand(c,this._contentWindow);
}},_onResizeEnd:function(c){if(this._pendingResizeCmd){this.executeCommand(this._pendingResizeCmd);
}},_onDragStart:function(f){var c=this.get_localization()["MoveCommand"]||"Move";
this._pendingMoveCommand=new a.Editor.GenericCommand(c,this.get_contentArea());
this._startRange=null;
if(!f.ctrlKey&&!f.ctrlLeft){this._startRange=this._contentWindow.document.selection.createRange();
if(this._startRange.length){var d=this._contentWindow.document.body.createTextRange();
var g=this._startRange.item(0);
if("IMG"==g.tagName&&"A"==g.parentNode.tagName&&g.parentNode.childNodes.length==1){g=g.parentNode;
}d.moveToElementText(g);
this._startRange=d;
}}},_onDragEnd:function(d){if(this._pendingMoveCommand){if(this._startRange){var f=this._contentWindow.document.selection.createRange();
if(f.length){var c=this._contentWindow.document.body.createTextRange();
c.moveToElementText(f.item(0));
f=c;
}try{if(f.compareEndPoints&&0!=f.compareEndPoints("StartToStart",this._startRange)&&0!=f.compareEndPoints("EndToEnd",this._startRange)){this._startRange.execCommand("Delete",false,null);
}}catch(d){}}this.executeCommand(this._pendingMoveCommand);
this._pendingMoveCommand=null;
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}},_onDrop:function(d){this._saveTypedContent(false,"on drop operation executing");
var c=this.get_localization()["Drop"]||"Drop external content";
this._pendingDockCommand=new a.Editor.GenericCommand(c,this._contentWindow);
},_onDocumentDragEnd:function(c){if(!this._pendingDockCommand){return;
}this.executeCommand(this._pendingDockCommand);
this._pendingDockCommand=null;
this.raiseEvent("selectionChange",Sys.EventArgs.Empty);
}};
b.registerControlProperties(a.RadEditor,{ajaxSpellCheckScriptReference:"",spellAllowAddCustom:true,spellCheckJSON:{},toolAdapter:null,fullPage:null,dialogOpener:null,links:[],colors:["","#000000","#eeece1","#1f497d","#4f81bd","#c0504d","#9bbb59","#8064a2","#4bacc6","#f79646","#ffffff","#7f7f7f","#ddd9c3","#c6d9f0","#dbe5f1","#f2dcdb","#ebf1dd","#e5e0ec","#dbeef3","#fdeada","#f2f2f2","#595959","#c4bd97","#8db3e2","#b8cce4","#e5b9b7","#d7e3bc","#ccc1d9","#b7dde8","#fbd5b5","#d8d8d8","#3f3f3f","#938953","#548dd4","#95b3d7","#d99694","#c3d69b","#b2a2c7","#92cddc","#fac08f","#bfbfbf","#262626","#494429","#17365d","#366092","#953734","#76923c","#5f497a","#31859b","#e36c09","#a5a5a5","#0c0c0c","#1d1b10","#0f243e","#244061","#632423","#4f6128","#3f3151","#205867","#974806","#c00000","#ff0000","#ffc000","#ffff00","#92d050","#00b050","#00b0f0","#0070c0","#002060","#7030a0"],fontNames:["Arial","Courier New","Garamond","Georgia","MS Sans Serif","Segoe UI","Tahoma","Times New Roman","Verdana"],fontSizes:[1,2,3,4,5,6,7],symbols:["&#8364;","&#162;","&#163;","&#165;","&#164;","&#169;","&#174;","&#8482;","&#177;","&ne;","&#8776;","&#8804;","&#8805;","&#247;","&#215;","&#8734;","&#189;","&#188;","&#190;","&#178;","&#179;","&#8240;","&#182;","&#167;","&#945;","&#946;","&#916;","&#181;","&#937;","&#8721;","&#216;","&ang;","&#186;","&#171;","&raquo;","&#183;","&#8226;","&#8224;","&#8225;","&#402;"],realFontSizes:["8px","9px","10px","11px","12px","13px","14px","16px","18px","20px","22px","24px","26px","28px","32px","36px","48px","72px"],contextMenus:[],snippets:[],cssClasses:[],cssFiles:[],languages:[],paragraphs:[["<p>","Normal"],["<h1>","<h1>Heading 1</h1>"],["<h2>","<h2>Heading 2</h2>"],["<h3>","<h3>Heading 3</h3>"],["<h4>","<h4>Heading 4</h4>"],["<h5>","<h5>Heading 5</h5>"],["<h5>","<dir>Directory List</dir>"],["<menu>","<menu>Menu List</menu>"],["<pre>","<pre>Formatted</pre>"],["<address>","<address>Address</address>"]],toolsWidth:null,maxTextLength:null,maxHtmlLength:null,toolProviderID:null,autoResizeHeight:false,toolbarMode:a.EditorToolbarMode.Default,editModes:a.EditModes.All,stripFormattingOptions:a.StripFormattingOptions.None,contentFilters:a.EditorFilters.DefaultFilters,newLineBr:true,contentAreaCssFile:"",tableLayoutCssFile:"",mozillaFlashOverlayImage:"FlashManager.gif",toolAdapterType:"",enableResize:true,toolJSON:[],modulesJSON:[],contextMenusJSON:[],skin:"Default"});
b.registerControlEvents(a.RadEditor,["firstShow","pasteHtml","editReady","submit","commandExecuted","commandExecuting","selectionChange","init","load","modeChange","toggleScreenMode","spellCheckLoaded"]);
a.RadEditor.registerClass("Telerik.Web.UI.RadEditor",a.RadWebControl);
})();
